@@ -211,8 +211,13 @@ def stats_cmd(args):
211211 "total" , help_text = "Total number of partitions" , type = "counter"
212212 )
213213 metrics .describe (
214- "time_since_last_partitioned_seconds" ,
215- help_text = "How many seconds since the last partition was created" ,
214+ "time_since_newest_partition_seconds" ,
215+ help_text = "The age in seconds of the last partition for the table" ,
216+ type = "gauge" ,
217+ )
218+ metrics .describe (
219+ "time_since_oldest_partition_seconds" ,
220+ help_text = "The age in seconds of the first partition for the table" ,
216221 type = "gauge" ,
217222 )
218223 metrics .describe (
@@ -229,11 +234,17 @@ def stats_cmd(args):
229234 for table , results in all_results .items ():
230235 if "partitions" in results :
231236 metrics .add ("total" , table , results ["partitions" ])
232- if "time_since_last_partition" in results :
237+ if "time_since_newest_partition" in results :
238+ metrics .add (
239+ "time_since_newest_partition_seconds" ,
240+ table ,
241+ results ["time_since_newest_partition" ].total_seconds (),
242+ )
243+ if "time_since_oldest_partition" in results :
233244 metrics .add (
234- "time_since_last_partitioned_seconds " ,
245+ "time_since_oldest_partition_seconds " ,
235246 table ,
236- results ["time_since_last_partition " ].total_seconds (),
247+ results ["time_since_oldest_partition " ].total_seconds (),
237248 )
238249 if "mean_partition_delta" in results :
239250 metrics .add (
0 commit comments