@@ -153,6 +153,8 @@ def exporter_datasink_common(
153
153
topology_spec_name ,
154
154
default_metrics = None ,
155
155
git_hash = None ,
156
+ collect_commandstats = True ,
157
+ collect_memory_metrics = True ,
156
158
):
157
159
logging .info (
158
160
f"Using datapoint_time_ms: { datapoint_time_ms } . git_hash={ git_hash } , git_branch={ git_branch } , git_version={ git_version } . gh_org={ tf_github_org } , gh_repo={ tf_github_repo } "
@@ -181,71 +183,77 @@ def exporter_datasink_common(
181
183
None ,
182
184
git_hash ,
183
185
)
184
- logging .info ("Collecting memory metrics" )
185
- (
186
- _ ,
187
- _ ,
188
- overall_end_time_metrics ,
189
- ) = collect_redis_metrics (
190
- redis_conns ,
191
- ["memory" ],
192
- {
193
- "memory" : [
194
- "used_memory" ,
195
- "used_memory_dataset" ,
196
- ]
197
- },
198
- )
199
- print (overall_end_time_metrics )
200
- # 7 days from now
201
- expire_redis_metrics_ms = 7 * 24 * 60 * 60 * 1000
202
- export_redis_metrics (
203
- git_version ,
204
- datapoint_time_ms ,
205
- overall_end_time_metrics ,
206
- datasink_conn ,
207
- setup_name ,
208
- setup_type ,
209
- test_name ,
210
- git_branch ,
211
- tf_github_org ,
212
- tf_github_repo ,
213
- tf_triggering_env ,
214
- {"metric-type" : "redis-metrics" },
215
- expire_redis_metrics_ms ,
216
- )
217
- logging .info ("Collecting commandstat metrics" )
218
- (
219
- _ ,
220
- _ ,
221
- overall_commandstats_metrics ,
222
- ) = collect_redis_metrics (redis_conns , ["commandstats" ])
223
- export_redis_metrics (
224
- git_version ,
225
- datapoint_time_ms ,
226
- overall_commandstats_metrics ,
227
- datasink_conn ,
228
- setup_name ,
229
- setup_type ,
230
- test_name ,
231
- git_branch ,
232
- tf_github_org ,
233
- tf_github_repo ,
234
- tf_triggering_env ,
235
- {"metric-type" : "commandstats" },
236
- expire_redis_metrics_ms ,
237
- )
186
+ if collect_memory_metrics :
187
+ logging .info ("Collecting memory metrics" )
188
+ (
189
+ _ ,
190
+ _ ,
191
+ overall_end_time_metrics ,
192
+ ) = collect_redis_metrics (
193
+ redis_conns ,
194
+ ["memory" ],
195
+ {
196
+ "memory" : [
197
+ "used_memory" ,
198
+ "used_memory_dataset" ,
199
+ ]
200
+ },
201
+ )
202
+ print (overall_end_time_metrics )
203
+ # 7 days from now
204
+ expire_redis_metrics_ms = 7 * 24 * 60 * 60 * 1000
205
+ export_redis_metrics (
206
+ git_version ,
207
+ datapoint_time_ms ,
208
+ overall_end_time_metrics ,
209
+ datasink_conn ,
210
+ setup_name ,
211
+ setup_type ,
212
+ test_name ,
213
+ git_branch ,
214
+ tf_github_org ,
215
+ tf_github_repo ,
216
+ tf_triggering_env ,
217
+ {"metric-type" : "redis-memory-metrics" },
218
+ expire_redis_metrics_ms ,
219
+ git_hash ,
220
+ running_platform ,
221
+ )
222
+ if collect_commandstats :
223
+ logging .info ("Collecting commandstat metrics" )
224
+ (
225
+ _ ,
226
+ _ ,
227
+ overall_commandstats_metrics ,
228
+ ) = collect_redis_metrics (redis_conns , ["commandstats" ])
229
+ export_redis_metrics (
230
+ git_version ,
231
+ datapoint_time_ms ,
232
+ overall_commandstats_metrics ,
233
+ datasink_conn ,
234
+ setup_name ,
235
+ setup_type ,
236
+ test_name ,
237
+ git_branch ,
238
+ tf_github_org ,
239
+ tf_github_repo ,
240
+ tf_triggering_env ,
241
+ {"metric-type" : "commandstats" },
242
+ expire_redis_metrics_ms ,
243
+ git_hash ,
244
+ running_platform ,
245
+ )
238
246
239
247
# Update deployment tracking sets
240
248
deployment_type_and_name = f"{ setup_type } _AND_{ setup_name } "
241
249
deployment_type_and_name_and_version = f"{ setup_type } _AND_{ setup_name } _AND_{ git_version } "
242
250
243
251
# Add to deployment-specific set
244
- deployment_set_key = f"ci.benchmarks.redislabs /{ tf_triggering_env } /{ deployment_type_and_name_and_version } :set"
252
+ deployment_set_key = f"ci.benchmarks.redis /{ tf_triggering_env } /{ deployment_type_and_name_and_version } :set"
245
253
datasink_conn .sadd (deployment_set_key , test_name )
246
254
247
255
# Add to testcases set
248
- testcases_set_key = f"ci.benchmarks.redislabs /{ tf_triggering_env } /testcases:set"
256
+ testcases_set_key = f"ci.benchmarks.redis /{ tf_triggering_env } /testcases:set"
249
257
datasink_conn .sadd (testcases_set_key , test_name )
250
258
251
259
# Add metadata fields to timeseries metadata
0 commit comments