File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
src/internal-packages/collection-stats/lib Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,12 @@ const AVG_SIZE = 'avg. size';
41
41
* The default stats state.
42
42
*/
43
43
const DEFAULT_STATS = {
44
- documentCount : 'N/A' ,
45
- totalDocumentSize : 'N/A' ,
46
- avgDocumentSize : 'N/A' ,
47
- indexCount : 'N/A' ,
48
- totalIndexSize : 'N/A' ,
49
- avgIndexSize : 'N/A'
44
+ documentCount : INVALID ,
45
+ totalDocumentSize : INVALID ,
46
+ avgDocumentSize : INVALID ,
47
+ indexCount : INVALID ,
48
+ totalIndexSize : INVALID ,
49
+ avgIndexSize : INVALID
50
50
} ;
51
51
52
52
/**
@@ -56,6 +56,8 @@ class CollectionStats extends React.Component {
56
56
57
57
/**
58
58
* Instantiate the component.
59
+ *
60
+ * @param {Object } props - The properties.
59
61
*/
60
62
constructor ( props ) {
61
63
super ( props ) ;
@@ -78,6 +80,8 @@ class CollectionStats extends React.Component {
78
80
79
81
/**
80
82
* Handle the loading of the collection stats.
83
+ *
84
+ * @param {Object } stats - The stats.
81
85
*/
82
86
handleStatsLoad ( stats ) {
83
87
this . setState ( stats || DEFAULT_STATS ) ;
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ const CollectionStatsStore = Reflux.createStore({
25
25
26
26
/**
27
27
* Load the collection stats.
28
+ *
29
+ * @param {String } ns - The namespace.
28
30
*/
29
31
loadCollectionStats : function ( ns ) {
30
32
if ( toNS ( ns || '' ) . collection ) {
@@ -41,14 +43,13 @@ const CollectionStatsStore = Reflux.createStore({
41
43
} ,
42
44
43
45
_parseCollectionDetails ( result ) {
44
- console . log ( result ) ;
45
46
return {
46
47
documentCount : this . _format ( result . document_count ) ,
47
48
totalDocumentSize : this . _format ( result . document_size , 'b' ) ,
48
49
avgDocumentSize : this . _format ( this . _avg ( result . document_size , result . document_count ) , 'b' ) ,
49
50
indexCount : this . _format ( result . index_count ) ,
50
51
totalIndexSize : this . _format ( result . index_size , 'b' ) ,
51
- avgIndexSize : this . _format ( this . _avg ( result . index_size , result . index_count ) , 'b' ) ,
52
+ avgIndexSize : this . _format ( this . _avg ( result . index_size , result . index_count ) , 'b' )
52
53
} ;
53
54
} ,
54
55
You can’t perform that action at this time.
0 commit comments