@@ -32,7 +32,8 @@ module.exports = Schema.extend({
3232 is_fetching : {
3333 type : 'boolean' ,
3434 default : false
35- }
35+ } ,
36+ lastOptions : 'object'
3637 } ,
3738 namespace : 'SampledSchema' ,
3839 collections : {
@@ -92,11 +93,12 @@ module.exports = Schema.extend({
9293 */
9394 fetch : function ( options ) {
9495 this . is_fetching = true ;
95- options = _ . defaults ( options || { } , {
96- size : 100 ,
96+ options = _ . defaults ( options || this . lastOptions || { } , {
97+ size : 1000 ,
9798 query : { } ,
9899 fields : null
99100 } ) ;
101+ this . lastOptions = _ . clone ( options ) ;
100102
101103 var model = this ;
102104 wrapError ( this , options ) ;
@@ -167,6 +169,15 @@ module.exports = Schema.extend({
167169
168170 model . trigger ( 'request' , { } , { } , options ) ;
169171
172+ app . statusbar . set ( {
173+ animation : true ,
174+ progressbar : true ,
175+ width : 100
176+ } ) ;
177+ app . statusbar . showSubview ( schemaStatusSubview ) ;
178+ app . statusbar . width = 1 ;
179+ app . statusbar . trickle ( true ) ;
180+
170181 app . dataService . count ( model . ns , options . query , options , function ( err , count ) {
171182 if ( err ) {
172183 return onFail ( err ) ;
@@ -181,15 +192,6 @@ module.exports = Schema.extend({
181192 var numSamples = Math . min ( options . size , count ) ;
182193 var stepSize = Math . ceil ( Math . max ( 1 , numSamples / 10 ) ) ;
183194
184- app . statusbar . set ( {
185- animation : true ,
186- progressbar : true ,
187- width : 100
188- } ) ;
189- app . statusbar . showSubview ( schemaStatusSubview ) ;
190- app . statusbar . width = 1 ;
191- app . statusbar . trickle ( true ) ;
192-
193195 model . samplingStream = app . dataService . sample ( model . ns , options ) ;
194196 // pass in true for native (fast) sampler, false for ampersand-sampler
195197 model . analyzingStream = model . stream ( true ) ;
0 commit comments