hydra-queue-runner: Keep some notification statistics

[?]
Jul 24, 2017, 2:26 PM
JPHDKOMJEDZQYRACBIJ57SJME7IZNLDJY7RB6QR47KG7IL3PG7UAC

Dependencies

  • [2] SL3WSRAC hydra-queue-runner: Limit memory usage
  • [*] 24BMQDZA Start of single-process hydra-queue-runner
  • [*] IE2PRAQU hydra-queue-runner: Send build notifications
  • [*] HJOEIMLR Refactor
  • [*] BRAESISH Warn if PostgreSQL appears stalled

Change contents

  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 487
    [5.1801]
    [5.1801]
    MaintainCount mc(nrNotificationsInProgress);
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 492
    [5.1897]
    [5.1897]
    auto now1 = std::chrono::steady_clock::now();
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 520
    [5.2506]
    [5.2506]
    auto now2 = std::chrono::steady_clock::now();
    nrNotificationTimeMs += std::chrono::duration_cast<std::chrono::milliseconds>(now2 - now1).count();
    nrNotificationsDone++;
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 526
    [5.2545]
    [5.2545]
    nrNotificationsFailed++;
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 602
    [2.1487]
    [2.1487]
    root.attr("nrNotificationsDone", nrNotificationsDone);
    root.attr("nrNotificationsFailed", nrNotificationsFailed);
    root.attr("nrNotificationsInProgress", nrNotificationsInProgress);
    root.attr("nrNotificationsPending", notificationSenderQueue.lock()->size());
    root.attr("nrNotificationTimeMs", nrNotificationTimeMs);
    uint64_t nrNotificationsTotal = nrNotificationsDone + nrNotificationsFailed;
    root.attr("nrNotificationTimeAvgMs", nrNotificationsTotal == 0 ? 0.0 : (float) nrNotificationTimeMs / nrNotificationsTotal);
  • edit in src/hydra-queue-runner/state.hh at line 337
    [7.910]
    [6.6084]
    counter nrNotificationsDone{0};
    counter nrNotificationsFailed{0};
    counter nrNotificationsInProgress{0};
    counter nrNotificationTimeMs{0};