5 commented on code in PR #204:
URL: https://github.com/apache/cassandra-sidecar/pull/204#discussion_r1994314362


##########
server/src/test/java/org/apache/cassandra/sidecar/datahub/SchemaReporterTest.java:
##########
@@ -107,20 +141,29 @@ void testEmptyTable() throws IOException
         when(options.getComment()).thenReturn("table comment");
 
         JsonEmitter emitter = new JsonEmitter();
-        new SchemaReporter(IDENTIFIERS, () -> emitter)
-                .process(cluster);
+        new SchemaReporter(IDENTIFIERS, () -> emitter, metrics)
+                .processRequested(metadata);
 
         String actual = emitter.content();
         String expected = IOUtils.readFully("/datahub/empty_table.json");
-
         assertEquals(expected, actual);
+
+        SchemaReportingMetrics metrics = 
this.metrics.server().schemaReporting();            // Validate captured 
metrics:
+        assertEquals(1L, metrics.startedRequest.metric.getValue());            
              //  * one execution triggered by request
+        assertEquals(0L, metrics.startedSchedule.metric.getValue());           
              //  * zero executions triggered by schedule
+        assertEquals(1L, metrics.finishedSuccess.metric.getValue());           
              //  * one execution resulted in success
+        assertEquals(0L, metrics.finishedFailure.metric.getValue());           
              //  * zero executions resulted in failure
+        assertEquals(1L, metrics.sizeAspects.metric.getCount());               
              //  * single number of aspects,
+        assertEquals(13L, 
metrics.sizeAspects.metric.getSnapshot().getValues()[0]);          //    equal 
to thirteen
+        assertEquals(1L, metrics.durationMilliseconds.metric.getCount());      
              //  * single duration of execution,
+        assertTrue(0L <= 
metrics.durationMilliseconds.metric.getSnapshot().getValues()[0]);  //    that 
is non-negative

Review Comment:
   Switched to the new syntax.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to