@@ -179,7 +179,7 @@ impl Timer {
179179 Err ( _) => {
180180 self . 0 . stop_and_discard ( ) ;
181181 }
182- } ;
182+ }
183183 result
184184 }
185185}
@@ -201,85 +201,85 @@ impl std::error::Error for Error {}
201201#[ derive( Debug , Clone ) ]
202202pub struct ErrorMetrics {
203203 /// the connector received an invalid request.
204- invalid_request_total : IntCounter ,
204+ invalid_request : IntCounter ,
205205 /// the connector received a request using capabilities it does not support.
206- unsupported_capability_total : IntCounter ,
206+ unsupported_capability : IntCounter ,
207207 /// the connector could not fulfill a request because it does not support
208208 /// certain features (which are not described as capabilities).
209- unsupported_feature_total : IntCounter ,
209+ unsupported_feature : IntCounter ,
210210 /// the connector had an internal error.
211- connector_error_total : IntCounter ,
211+ connector_error : IntCounter ,
212212 /// the database emmited an error.
213- database_error_total : IntCounter ,
213+ database_error : IntCounter ,
214214 /// we failed to acquire a database connection from the pool
215- connection_acquisition_error_total : IntCounter ,
215+ connection_acquisition_error : IntCounter ,
216216}
217217
218218impl ErrorMetrics {
219219 /// Set up counters and gauges used to produce Prometheus metrics
220220 pub fn initialize ( metrics_registry : & mut prometheus:: Registry ) -> Result < Self , Error > {
221- let invalid_request_total = add_int_counter_metric (
221+ let invalid_request = add_int_counter_metric (
222222 metrics_registry,
223- "ndc_sqlserver_error_invalid_request_total_count " ,
223+ "ndc_sqlserver_error_invalid_request_count " ,
224224 "Total number of invalid requests encountered." ,
225225 ) ?;
226226
227- let unsupported_capability_total = add_int_counter_metric (
227+ let unsupported_capability = add_int_counter_metric (
228228 metrics_registry,
229- "ndc_sqlserver_error_unsupported_capability_total_count " ,
229+ "ndc_sqlserver_error_unsupported_capability_count " ,
230230 "Total number of invalid requests with unsupported capabilities encountered." ,
231231 ) ?;
232232
233- let unsupported_feature_total = add_int_counter_metric (
233+ let unsupported_feature = add_int_counter_metric (
234234 metrics_registry,
235- "ndc_sqlserver_error_unsupported_capabilities_total_count " ,
235+ "ndc_sqlserver_error_unsupported_capabilities_count " ,
236236 "Total number of invalid requests with unsupported capabilities encountered." ,
237237 ) ?;
238238
239- let connector_error_total = add_int_counter_metric (
239+ let connector_error = add_int_counter_metric (
240240 metrics_registry,
241- "ndc_sqlserver_error_connector_error_total_count " ,
241+ "ndc_sqlserver_error_connector_error_count " ,
242242 "Total number of requests failed due to an internal conenctor error." ,
243243 ) ?;
244244
245- let database_error_total = add_int_counter_metric (
245+ let database_error = add_int_counter_metric (
246246 metrics_registry,
247- "ndc_sqlserver_error_database_error_total_count " ,
247+ "ndc_sqlserver_error_database_error_count " ,
248248 "Total number of requests failed due to a database error." ,
249249 ) ?;
250250
251- let connection_acquisition_error_total = add_int_counter_metric (
251+ let connection_acquisition_error = add_int_counter_metric (
252252 metrics_registry,
253- "ndc_sqlserver_error_connection_acquisition_error_total_count " ,
253+ "ndc_sqlserver_error_connection_acquisition_error_count " ,
254254 "Total number of failures to acquire a database connection." ,
255255 ) ?;
256256
257257 Ok ( ErrorMetrics {
258- invalid_request_total ,
259- unsupported_capability_total ,
260- unsupported_feature_total ,
261- connector_error_total ,
262- database_error_total ,
263- connection_acquisition_error_total ,
258+ invalid_request ,
259+ unsupported_capability ,
260+ unsupported_feature ,
261+ connector_error ,
262+ database_error ,
263+ connection_acquisition_error ,
264264 } )
265265 }
266266
267267 pub fn record_invalid_request ( & self ) {
268- self . invalid_request_total . inc ( ) ;
268+ self . invalid_request . inc ( ) ;
269269 }
270270 pub fn record_unsupported_capability ( & self ) {
271- self . unsupported_capability_total . inc ( ) ;
271+ self . unsupported_capability . inc ( ) ;
272272 }
273273 pub fn record_unsupported_feature ( & self ) {
274- self . unsupported_feature_total . inc ( ) ;
274+ self . unsupported_feature . inc ( ) ;
275275 }
276276 pub fn record_connector_error ( & self ) {
277- self . connector_error_total . inc ( ) ;
277+ self . connector_error . inc ( ) ;
278278 }
279279 pub fn record_database_error ( & self ) {
280- self . database_error_total . inc ( ) ;
280+ self . database_error . inc ( ) ;
281281 }
282282 pub fn record_connection_acquisition_error ( & self ) {
283- self . connection_acquisition_error_total . inc ( )
283+ self . connection_acquisition_error . inc ( )
284284 }
285285}
0 commit comments