@@ -53,6 +53,11 @@ export const publish = async ({
53
53
54
54
logger . log ( `Publishing ${ measurements . length } measurements. Total unpublished: ${ totalCount } . Batch size: ${ maxMeasurements } .` )
55
55
56
+ // Calculate batch size in bytes
57
+ const batchSizeBytes = Buffer . byteLength (
58
+ measurements . map ( m => JSON . stringify ( m ) ) . join ( '\n' )
59
+ )
60
+
56
61
// Share measurements
57
62
const start = new Date ( )
58
63
const file = new File (
@@ -126,7 +131,9 @@ export const publish = async ({
126
131
127
132
logger . log ( 'Done!' )
128
133
134
+ // Enhanced telemetry recording with separate batch metrics
129
135
recordTelemetry ( 'publish' , point => {
136
+ // Existing metrics
130
137
point . intField ( 'round_index' , roundIndex )
131
138
point . intField ( 'measurements' , measurements . length )
132
139
point . floatField ( 'load' , totalCount / maxMeasurements )
@@ -136,6 +143,16 @@ export const publish = async ({
136
143
)
137
144
point . intField ( 'add_measurements_duration_ms' , ieAddMeasurementsDuration )
138
145
} )
146
+
147
+ // Separate batch metrics recording for better organization
148
+ recordTelemetry ( 'batch_metrics' , point => {
149
+ point . intField ( 'batch_size_bytes' , batchSizeBytes )
150
+ point . floatField ( 'avg_measurement_size_bytes' , batchSizeBytes / measurements . length )
151
+ point . intField ( 'measurement_count' , measurements . length )
152
+ point . tag ( 'cid' , cid . toString ( ) )
153
+ point . tag ( 'round_index' , roundIndex . toString ( ) )
154
+ point . timestamp ( new Date ( ) )
155
+ } )
139
156
}
140
157
141
158
const commitMeasurements = async ( { cid, ieContract, logger, stuckTransactionsCanceller } ) => {
0 commit comments