File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ module.exports ={
44
44
let value = this . getStringValue ( label ) ;
45
45
return value ? parseInt ( value ) : 0 ;
46
46
}
47
+
48
+ getFLoatValue ( label ) {
49
+ let value = this . getStringValue ( label ) ;
50
+ return value ? parseFloat ( value ) : 0 ;
51
+ }
52
+
47
53
48
54
nodesCreated ( ) {
49
55
return this . getIntValue ( Label . NODES_CREATED ) ;
@@ -70,7 +76,7 @@ module.exports ={
70
76
}
71
77
72
78
queryExecutionTime ( ) {
73
- return this . getIntValue ( Label . QUERY_INTERNAL_EXECUTION_TIME ) ;
79
+ return this . getFLoatValue ( Label . QUERY_INTERNAL_EXECUTION_TIME ) ;
74
80
}
75
81
76
82
}
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ describe('RedisGraphAPI Test', () =>{
24
24
assert . ifError ( result . getStatistics ( ) . getStringValue ( Label . RELATIONSHIPS_CREATED ) ) ;
25
25
assert . ifError ( result . getStatistics ( ) . getStringValue ( Label . RELATIONSHIPS_DELETED ) ) ;
26
26
assert . equal ( 2 , result . getStatistics ( ) . propertiesSet ( ) ) ;
27
- assert . ok ( result . getStatistics ( ) . getStringValue ( Label . QUERY_INTERNAL_EXECUTION_TIME ) ) ;
27
+ assert . ok ( result . getStatistics ( ) . queryExecutionTime ( ) ) ; // not 0
28
+ assert . ok ( result . getStatistics ( ) . getStringValue ( Label . QUERY_INTERNAL_EXECUTION_TIME ) ) ; // exsits
28
29
} ) ;
29
30
} ) ;
30
31
@@ -74,6 +75,8 @@ describe('RedisGraphAPI Test', () =>{
74
75
. then ( ( resultSet ) => {
75
76
assert . ok ( resultSet . hasNext ( ) ) ;
76
77
assert . equal ( 0 , resultSet . getStatistics ( ) . nodesCreated ( ) ) ;
78
+ assert . equal ( 0 , resultSet . getStatistics ( ) . nodesDeleted ( ) ) ;
79
+ assert . equal ( 0 , resultSet . getStatistics ( ) . labelsAdded ( ) ) ;
77
80
assert . equal ( 0 , resultSet . getStatistics ( ) . propertiesSet ( ) ) ;
78
81
assert . equal ( 0 , resultSet . getStatistics ( ) . relationshipsCreated ( ) ) ;
79
82
assert . equal ( 0 , resultSet . getStatistics ( ) . relationshipsDeleted ( ) ) ;
You can’t perform that action at this time.
0 commit comments