Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add file index to job stats

  • Loading branch information...
commit dcf624d4c6521804badfdc4f01f7bfa595b613ec 1 parent e50ec07
@kr authored
View
3  doc/protocol.txt
@@ -431,6 +431,9 @@ to scalars. It contains these keys:
reserved or delayed. If the job is reserved and this amount of time
elapses before its state changes, it is considered to have timed out.
+ - "file" is the number of the earliest binlog file containing this job.
+ If -b wasn't used, this will be 0.
+
- "reserves" is the number of times this job has been reserved.
- "timeouts" is the number of times this job has timed out during a
View
6 prot.c
@@ -207,6 +207,7 @@ size_t job_data_size_limit = JOB_DATA_SIZE_LIMIT_DEFAULT;
"delay: %" PRIu64 "\n" \
"ttr: %" PRIu64 "\n" \
"time-left: %" PRIu64 "\n" \
+ "file: %d\n" \
"reserves: %u\n" \
"timeouts: %u\n" \
"releases: %u\n" \
@@ -1039,6 +1040,7 @@ fmt_job_stats(char *buf, size_t size, job j)
{
int64 t;
int64 time_left;
+ int file = 0;
t = nanoseconds();
if (j->r.state == Reserved || j->r.state == Delayed) {
@@ -1046,6 +1048,9 @@ fmt_job_stats(char *buf, size_t size, job j)
} else {
time_left = 0;
}
+ if (j->file) {
+ file = j->file->seq;
+ }
return snprintf(buf, size, STATS_JOB_FMT,
j->r.id,
j->tube->name,
@@ -1055,6 +1060,7 @@ fmt_job_stats(char *buf, size_t size, job j)
j->r.delay / 1000000000,
j->r.ttr / 1000000000,
time_left,
+ file,
j->r.reserve_ct,
j->r.timeout_ct,
j->r.release_ct,
View
3  sh-tests/omit-time-left.expected
@@ -1,5 +1,5 @@
INSERTED 1
-OK 135
+OK 143
---
id: 1
tube: default
@@ -9,6 +9,7 @@ age: 0
delay: 0
ttr: 5
time-left: 0
+file: 0
reserves: 0
timeouts: 0
releases: 0
View
6 sh-tests/pause-tube.expected
@@ -57,7 +57,7 @@ cmd-pause-tube: 3
pause: 3
pause-time-left: 2
-OK 135
+OK 143
---
id: 2
tube: default
@@ -67,6 +67,7 @@ age: 1
delay: 1
ttr: 1
time-left: 0
+file: 0
reserves: 0
timeouts: 0
releases: 0
@@ -75,7 +76,7 @@ kicks: 0
RESERVED 2 1
2
-OK 138
+OK 146
---
id: 2
tube: default
@@ -85,6 +86,7 @@ age: 4
delay: 1
ttr: 1
time-left: 0
+file: 0
reserves: 1
timeouts: 0
releases: 0
View
21 sh-tests/ttr-large.expected
@@ -5,7 +5,7 @@ INSERTED 4
INSERTED 5
INSERTED 6
INSERTED 7
-OK 137
+OK 145
---
id: 1
tube: default
@@ -15,13 +15,14 @@ age: 0
delay: 0
ttr: 120
time-left: 0
+file: 0
reserves: 0
timeouts: 0
releases: 0
buries: 0
kicks: 0
-OK 138
+OK 146
---
id: 2
tube: default
@@ -31,13 +32,14 @@ age: 0
delay: 0
ttr: 4294
time-left: 0
+file: 0
reserves: 0
timeouts: 0
releases: 0
buries: 0
kicks: 0
-OK 138
+OK 146
---
id: 3
tube: default
@@ -47,13 +49,14 @@ age: 0
delay: 0
ttr: 4295
time-left: 0
+file: 0
reserves: 0
timeouts: 0
releases: 0
buries: 0
kicks: 0
-OK 138
+OK 146
---
id: 4
tube: default
@@ -63,13 +66,14 @@ age: 0
delay: 0
ttr: 4296
time-left: 0
+file: 0
reserves: 0
timeouts: 0
releases: 0
buries: 0
kicks: 0
-OK 138
+OK 146
---
id: 5
tube: default
@@ -79,13 +83,14 @@ age: 0
delay: 0
ttr: 4297
time-left: 0
+file: 0
reserves: 0
timeouts: 0
releases: 0
buries: 0
kicks: 0
-OK 138
+OK 146
---
id: 6
tube: default
@@ -95,13 +100,14 @@ age: 0
delay: 0
ttr: 5000
time-left: 0
+file: 0
reserves: 0
timeouts: 0
releases: 0
buries: 0
kicks: 0
-OK 139
+OK 147
---
id: 7
tube: default
@@ -111,6 +117,7 @@ age: 0
delay: 0
ttr: 21600
time-left: 0
+file: 0
reserves: 0
timeouts: 0
releases: 0
Please sign in to comment.
Something went wrong with that request. Please try again.