Browse Source

Show more EMM counters in stats messages.

This patch adds two new EMM counters in the regular stats messages.

Now the counters are:

 Received  - How much EMMs were received from the input.
 Skipped   - How much EMMs were skipped because of filtering.
 Sent      - How much EMMs were added to the sending queue.
 Processed - How much EMMs were sent to the CAMD server for processing.
Georgi Chorbadzhiyski 11 years ago
parent
commit
d617624e6f
3 changed files with 9 additions and 1 deletions
  1. 2
    0
      data.h
  2. 2
    0
      tables.c
  3. 5
    1
      tsdecrypt.c

+ 2
- 0
data.h View File

@@ -212,8 +212,10 @@ struct ts {
212 212
 	pidmap_t			pid_seen;
213 213
 
214 214
 	// Stats
215
+	unsigned int		emm_input_count;
215 216
 	unsigned int		emm_seen_count;
216 217
 	unsigned int		emm_processed_count;
218
+	unsigned int		emm_skipped_count;
217 219
 	unsigned int		emm_report_interval;
218 220
 	time_t				emm_last_report;
219 221
 

+ 2
- 0
tables.c View File

@@ -259,6 +259,8 @@ static void __process_emm(struct ts *ts, uint16_t pid, uint8_t *ts_packet) {
259 259
 
260 260
 	show_ts_pack(ts, pid, "emm", NULL, ts_packet);
261 261
 
262
+	ts->emm_input_count++;
263
+
262 264
 	if (!ts->emm_send)
263 265
 		return;
264 266
 

+ 5
- 1
tsdecrypt.c View File

@@ -800,7 +800,9 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
800 800
 }
801 801
 
802 802
 static void report_emms(struct ts *ts, time_t now) {
803
-	ts_LOGf("EMM | Received %u and processed %u in %lu seconds.\n",
803
+	ts_LOGf("EMM | Received %u, Skipped %u, Sent %u, Processed %u in %lu seconds.\n",
804
+		ts->emm_input_count,
805
+		ts->emm_skipped_count,
804 806
 		ts->emm_seen_count,
805 807
 		ts->emm_processed_count,
806 808
 		now - ts->emm_last_report);
@@ -809,7 +811,9 @@ static void report_emms(struct ts *ts, time_t now) {
809 811
 			now - ts->emm_last_report);
810 812
 	}
811 813
 	ts->emm_last_report = now;
814
+	ts->emm_input_count = 0;
812 815
 	ts->emm_seen_count = 0;
816
+	ts->emm_skipped_count = 0;
813 817
 	ts->emm_processed_count = 0;
814 818
 }
815 819
 

Loading…
Cancel
Save