System.Data.SQLite

Check-in [2000da5b93]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Further enhancements to the memory usage stress test.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | memoryUsage
Files: files | file ages | folders
SHA1: 2000da5b930a77a0ddaf026808cf59c2ce25ac79
User & Date: mistachkin 2015-10-19 17:22:29.689
Context
2015-10-19
17:23
Add memory usage stress test. check-in: 67d28724d6 user: mistachkin tags: trunk
17:22
Further enhancements to the memory usage stress test. Closed-Leaf check-in: 2000da5b93 user: mistachkin tags: memoryUsage
05:16
Fixes and tweaks to the previous check-in. check-in: 9a14ecd4bc user: mistachkin tags: memoryUsage
Changes
Unified Diff Ignore Whitespace Patch
Changes to Tests/memory.eagle.
53
54
55
56
57
58
59




60
61
62
63


64
65
66
67
68
69
70
71
72
73
74
75
76
77
78


79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

104
105





106
107
108
109
110
111
112
  setupDb [set fileName $test_repository_file] \
      "" "" "" "" "Read Only=True" false false
} -body {
  set connection [getDbConnection]

  set sql "SELECT rid, rcvid, size, uuid, content FROM blob ORDER BY rid;"





  set dataReader [sql execute -execute reader -format datareader \
      -alias $db $sql]

  while {[$dataReader Read]} {


    set working(rid) [$dataReader GetValue \
        [$dataReader GetOrdinal rid]]

    set working(rcvid) [$dataReader GetValue \
        [$dataReader GetOrdinal rcvid]]

    set working(size) [$dataReader GetValue \
        [$dataReader GetOrdinal size]]

    set working(uuid) [$dataReader GetValue \
        [$dataReader GetOrdinal uuid]]

    set working(content) [$dataReader -create -alias GetValue \
        [$dataReader GetOrdinal content]]



    set working(counter1Cur) [$counter(1) RawValue]
    set working(counter2Cur) [$counter(2) RawValue]
    set working(counter3Cur) [$counter(3) RawValue]

    if {![info exists working(counter1Max)] || \
        $working(counter1Cur) > $working(counter1Max)} then {
      set working(counter1Max) $working(counter1Cur)
      reportMemoryCounters $test_channel counter "new maximum"
      cleanupMemory connection
    }

    if {![info exists working(counter2Max)] || \
        $working(counter2Cur) > $working(counter2Max)} then {
      set working(counter2Max) $working(counter2Cur)
      reportMemoryCounters $test_channel counter "new maximum"
      cleanupMemory connection
    }

    if {![info exists working(counter3Max)] || \
        $working(counter3Cur) > $working(counter3Max)} then {
      set working(counter3Max) $working(counter3Cur)
      reportMemoryCounters $test_channel counter "new maximum"
      cleanupMemory connection
    }
  }


  reportMemoryCounters $test_channel counter final





} -cleanup {
  freeDbConnection

  unset -nocomplain dataReader connection

  cleanupDb $fileName db true false false








>
>
>
>
|
|

|
>
>
|
|

|
|

|
|

|
|

|
|

>
>
|
|
|

|
|
|
|
|
|

|
|
|
|
|
|

|
|
|
|
|
|
|
>


>
>
>
>
>







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
  setupDb [set fileName $test_repository_file] \
      "" "" "" "" "Read Only=True" false false
} -body {
  set connection [getDbConnection]

  set sql "SELECT rid, rcvid, size, uuid, content FROM blob ORDER BY rid;"

  set working(rowCount) 0
  set working(contentLength) 0

  set working(time) [time {
    set dataReader [sql execute -execute reader -format datareader \
        -alias $db $sql]

    while {[$dataReader Read]} {
      incr working(rowCount)

      set working(rid) [$dataReader GetValue \
          [$dataReader GetOrdinal rid]]

      set working(rcvid) [$dataReader GetValue \
          [$dataReader GetOrdinal rcvid]]

      set working(size) [$dataReader GetValue \
          [$dataReader GetOrdinal size]]

      set working(uuid) [$dataReader GetValue \
          [$dataReader GetOrdinal uuid]]

      set working(content) [$dataReader -create -alias GetValue \
          [$dataReader GetOrdinal content]]

      incr working(contentLength) [$working(content) Length]

      set working(counter1Cur) [$counter(1) RawValue]
      set working(counter2Cur) [$counter(2) RawValue]
      set working(counter3Cur) [$counter(3) RawValue]

      if {![info exists working(counter1Max)] || \
          $working(counter1Cur) > $working(counter1Max)} then {
        set working(counter1Max) $working(counter1Cur)
        reportMemoryCounters $test_channel counter current
        cleanupMemory connection
      }

      if {![info exists working(counter2Max)] || \
          $working(counter2Cur) > $working(counter2Max)} then {
        set working(counter2Max) $working(counter2Cur)
        reportMemoryCounters $test_channel counter current
        cleanupMemory connection
      }

      if {![info exists working(counter3Max)] || \
          $working(counter3Cur) > $working(counter3Max)} then {
        set working(counter3Max) $working(counter3Cur)
        reportMemoryCounters $test_channel counter current
        cleanupMemory connection
      }
    }
  }]

  reportMemoryCounters $test_channel counter final

  tputs $test_channel [appendArgs \
      "---- found " $working(rowCount) " rows with " \
      $working(contentLength) " bytes of content in " \
      $working(time) \n]
} -cleanup {
  freeDbConnection

  unset -nocomplain dataReader connection

  cleanupDb $fileName db true false false