File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -124,9 +124,12 @@ pub fn metrics_handler(req: &mut Request) -> IronResult<Response> {
124
124
. get ( 0 ) ,
125
125
) ;
126
126
PRIORITIZED_CRATES_COUNT . set (
127
- ctry ! ( conn. query( "SELECT COUNT(*) FROM queue WHERE priority >= 0;" , & [ ] ) )
128
- . get ( 0 )
129
- . get ( 0 ) ,
127
+ ctry ! ( conn. query(
128
+ "SELECT COUNT(*) FROM queue WHERE attempt < 5 AND priority <= 0;" ,
129
+ & [ ]
130
+ ) )
131
+ . get ( 0 )
132
+ . get ( 0 ) ,
130
133
) ;
131
134
FAILED_CRATES_COUNT . set (
132
135
ctry ! ( conn. query( "SELECT COUNT(*) FROM queue WHERE attempt >= 5;" , & [ ] ) )
@@ -196,7 +199,7 @@ impl iron::Handler for RequestRecorder {
196
199
197
200
#[ cfg( test) ]
198
201
mod tests {
199
- use crate :: test:: wrapper;
202
+ use crate :: test:: { assert_success , wrapper} ;
200
203
use std:: {
201
204
collections:: HashMap ,
202
205
sync:: {
@@ -358,4 +361,12 @@ mod tests {
358
361
Ok ( ( ) )
359
362
} )
360
363
}
364
+
365
+ #[ test]
366
+ fn metrics ( ) {
367
+ wrapper ( |env| {
368
+ let web = env. frontend ( ) ;
369
+ assert_success ( "/about/metrics" , web)
370
+ } )
371
+ }
361
372
}
You can’t perform that action at this time.
0 commit comments