@@ -122,8 +122,6 @@ impl Service<Vec<Metric>> for GreptimeDBService {
122
122
123
123
// Convert vector metrics into GreptimeDB format and send them in batch
124
124
fn call ( & mut self , items : Vec < Metric > ) -> Self :: Future {
125
- // TODO(sunng87): group metrics by name and send metrics with same name
126
- // in batch
127
125
let requests = items. into_iter ( ) . map ( metric_to_insert_request) ;
128
126
let client = Arc :: clone ( & self . client ) ;
129
127
@@ -187,7 +185,7 @@ fn metric_to_insert_request(metric: Metric) -> InsertRequest {
187
185
} ;
188
186
189
187
let mut columns = Vec :: new ( ) ;
190
- // timetamp
188
+ // timestamp
191
189
let timestamp = metric
192
190
. timestamp ( )
193
191
. map ( |t| t. timestamp_millis ( ) )
@@ -267,7 +265,6 @@ fn encode_histogram(buckets: &[Bucket], columns: &mut Vec<Column>) {
267
265
fn encode_quantiles ( quantiles : & [ Quantile ] , columns : & mut Vec < Column > ) {
268
266
for quantile in quantiles {
269
267
let column_name = format ! ( "p{:02}" , quantile. quantile * 100f64 ) ;
270
- dbg ! ( & column_name) ;
271
268
columns. push ( f64_field ( & column_name, quantile. value ) ) ;
272
269
}
273
270
}
@@ -328,7 +325,7 @@ mod tests {
328
325
MetricValue :: Gauge { value : 1.1 } ,
329
326
)
330
327
. with_namespace ( Some ( "ns" ) )
331
- . with_tags ( Some ( [ ( "host" . to_owned ( ) , "thinkneo " . to_owned ( ) ) ] . into ( ) ) )
328
+ . with_tags ( Some ( [ ( "host" . to_owned ( ) , "thinkpad " . to_owned ( ) ) ] . into ( ) ) )
332
329
. with_timestamp ( Some ( Utc :: now ( ) ) ) ;
333
330
334
331
let insert = metric_to_insert_request ( metric) ;
@@ -413,7 +410,7 @@ mod tests {
413
410
#[ test]
414
411
fn test_histogram ( ) {
415
412
let metric = Metric :: new (
416
- "cpu_seconds_totoal " ,
413
+ "cpu_seconds_total " ,
417
414
MetricKind :: Incremental ,
418
415
MetricValue :: AggregatedHistogram {
419
416
buckets : vector_core:: buckets![ 1.0 => 1 , 2.0 => 2 , 3.0 => 1 ] ,
@@ -434,7 +431,7 @@ mod tests {
434
431
#[ test]
435
432
fn test_summary ( ) {
436
433
let metric = Metric :: new (
437
- "cpu_seconds_totoal " ,
434
+ "cpu_seconds_total " ,
438
435
MetricKind :: Incremental ,
439
436
MetricValue :: AggregatedSummary {
440
437
quantiles : vector_core:: quantiles![ 0.01 => 1.5 , 0.5 => 2.0 , 0.99 => 3.0 ] ,
@@ -493,7 +490,7 @@ mod integration_tests {
493
490
std:: env:: var( "GREPTIMEDB_HTTP" )
494
491
. unwrap_or_else( |_| "http://localhost:4000" . to_owned( ) )
495
492
) )
496
- . query ( & [ ( "sql" , "SELECT region, value FROM ms_mycounter " ) ] )
493
+ . query ( & [ ( "sql" , "SELECT region, value FROM ns_my_counter " ) ] )
497
494
. send ( )
498
495
. await
499
496
. unwrap ( )
@@ -506,7 +503,7 @@ mod integration_tests {
506
503
result
507
504
. pointer( "/output/0/records/rows" )
508
505
. and_then( |v| v. as_array( ) )
509
- . expect( "Error getting greptimedb resposne array" )
506
+ . expect( "Error getting greptimedb response array" )
510
507
. len( ) ,
511
508
10
512
509
)
@@ -519,7 +516,7 @@ mod integration_tests {
519
516
fn create_event ( i : i32 ) -> Event {
520
517
Event :: Metric (
521
518
Metric :: new (
522
- format ! ( "mycounter " ) ,
519
+ format ! ( "my_counter " ) ,
523
520
MetricKind :: Incremental ,
524
521
MetricValue :: Counter { value : i as f64 } ,
525
522
)
0 commit comments