89
89
90
90
91
91
def is_important_data (tf_github_branch , artifact_version ):
92
- if artifact_version is not None or (
93
- tf_github_branch == "master" or tf_github_branch == "main"
94
- ):
95
- return True
96
- else :
97
- return False
92
+ return True
98
93
99
94
100
95
def run_remote_command_logic (args , project_name , project_version ):
@@ -812,6 +807,28 @@ def run_remote_command_logic(args, project_name, project_version):
812
807
{"metric-type" : "commandstats" },
813
808
expire_ms ,
814
809
)
810
+ (
811
+ end_time_ms ,
812
+ _ ,
813
+ overall_commandstats_metrics ,
814
+ ) = collect_redis_metrics (
815
+ redis_conns , ["latencystats" ]
816
+ )
817
+ export_redis_metrics (
818
+ artifact_version ,
819
+ end_time_ms ,
820
+ overall_commandstats_metrics ,
821
+ rts ,
822
+ setup_name ,
823
+ setup_type ,
824
+ test_name ,
825
+ tf_github_branch ,
826
+ tf_github_org ,
827
+ tf_github_repo ,
828
+ tf_triggering_env ,
829
+ {"metric-type" : "latencystats" },
830
+ expire_ms ,
831
+ )
815
832
816
833
if setup_details ["env" ] is None :
817
834
if (
@@ -1204,10 +1221,11 @@ def export_redis_metrics(
1204
1221
metric_name ,
1205
1222
metric_value ,
1206
1223
) in overall_end_time_metrics .items ():
1207
- tsname_metric = "{}/{}/{}/benchmark_end/{}" .format (
1224
+ tsname_metric = "{}/{}/{}/benchmark_end/{}/{} " .format (
1208
1225
sprefix ,
1209
1226
test_name ,
1210
1227
by_variant ,
1228
+ setup_name ,
1211
1229
metric_name ,
1212
1230
)
1213
1231
@@ -1219,8 +1237,18 @@ def export_redis_metrics(
1219
1237
tsname_metric ,
1220
1238
)
1221
1239
)
1222
- variant_labels_dict ["test_name" ] = test_name
1223
1240
variant_labels_dict ["metric" ] = metric_name
1241
+ commandstats_latencystats_process_name (
1242
+ metric_name , "commandstats_cmdstat_" , setup_name , variant_labels_dict
1243
+ )
1244
+ commandstats_latencystats_process_name (
1245
+ metric_name ,
1246
+ "latencystats_latency_percentiles_usec_" ,
1247
+ setup_name ,
1248
+ variant_labels_dict ,
1249
+ )
1250
+
1251
+ variant_labels_dict ["test_name" ] = test_name
1224
1252
if metadata_dict is not None :
1225
1253
variant_labels_dict .update (metadata_dict )
1226
1254
@@ -1243,6 +1271,28 @@ def export_redis_metrics(
1243
1271
return datapoint_errors , datapoint_inserts
1244
1272
1245
1273
1274
+ def commandstats_latencystats_process_name (
1275
+ metric_name , prefix , setup_name , variant_labels_dict
1276
+ ):
1277
+ if prefix in metric_name :
1278
+ command_and_metric_and_shard = metric_name [len (prefix ) :]
1279
+ command = (
1280
+ command_and_metric_and_shard [0 ]
1281
+ + command_and_metric_and_shard [1 :].split ("_" , 1 )[0 ]
1282
+ )
1283
+ metric_and_shard = command_and_metric_and_shard [1 :].split ("_" , 1 )[1 ]
1284
+ metric = metric_and_shard
1285
+ shard = "1"
1286
+ if "_shard_" in metric_and_shard :
1287
+ metric = metric_and_shard .split ("_shard_" )[0 ]
1288
+ shard = metric_and_shard .split ("_shard_" )[1 ]
1289
+ variant_labels_dict ["metric" ] = metric
1290
+ variant_labels_dict ["command" ] = command
1291
+ variant_labels_dict ["command_and_setup" ] = "{} - {}" .format (command , setup_name )
1292
+ variant_labels_dict ["shard" ] = shard
1293
+ variant_labels_dict ["metric_and_shard" ] = metric_and_shard
1294
+
1295
+
1246
1296
def shutdown_remote_redis (redis_conns , ssh_tunnel ):
1247
1297
logging .info ("Shutting down remote redis." )
1248
1298
for conn in redis_conns :
0 commit comments