)]}'
{
  "commit": "ba71d71c0b517b4e19ba151b29a7e3aac84809ab",
  "tree": "d1b3e6d0e38cee564e0d252f289f8e022a9fc6e5",
  "parents": [
    "fc318712756023ca7d301b4aca653812ee3d0e22"
  ],
  "author": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Mon Jul 15 07:34:12 2024 +0000"
  },
  "committer": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Mon Jul 15 07:49:12 2024 +0000"
  },
  "message": "PerformanceMetrics: Log per request latency for configured operations\n\nPerformanceMetrics has 2 metrics, one to record the latency of the\nconfigured operations and one to count how often the configured\noperations are invoked in total. To be able to estimate how much a\nlatency improvement improves the latency for a request, we add a third\nmetric that records the total latency of calling the configured\noperations during one request. This way we can know how much a certain\noperation contributes to the request latency in total, and how much a\nlatency improvement speeds up the request.\n\nE.g. at Google we migrate the accounts from NoteDb into another storage\nand we hope this will speed up the \"Loading account\" operations which\ncan be called many times during a request. Having the new metric allows\nus to see how much the latency of the different requests is improved by\nthis migration. Without the new metric we would only know how the\nlatency of the \"Loading account\" operation is improved, but not which\neffect this had on the request latencies.\n\nTo know the total latency of the configured operations we sum up the\nlatency per operation in memory when the logNanos methods are invoked.\nThen we use the total latency to record the new metric in a new\nPerformanceLogger#done() method that is invoked after all logs have been\nwritten. To be able to cache the total latency in memory the\nPerformanceMetrics PerformanceLogger can no longer be a singleton, but\nwe need a new instance for every request.\n\nRelease-Notes: skip\nChange-Id: I42fc1ab6328723fa05b0ed04979eef75f19f8d51\nSigned-off-by: Edwin Kempin \u003cekempin@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3d21fedbeb958312c631d23e110c32749b4daae7",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/PerformanceMetrics.java",
      "new_id": "b894d49badb0797800b38fe5c33174c3391569a0",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/PerformanceMetrics.java"
    },
    {
      "type": "modify",
      "old_id": "90e716f9a383e45579f4da5da3ba82bf8bb4f080",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/logging/PerformanceLogContext.java",
      "new_id": "8cf5b84a9eecda961893be6edbbd07faaac61bd6",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/logging/PerformanceLogContext.java"
    },
    {
      "type": "modify",
      "old_id": "fa61eb44370dd1a791406f2fe78c0982880db6b5",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/logging/PerformanceLogger.java",
      "new_id": "02fb37c6499f7a3e2e6caf75d488ff0785ecf332",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/logging/PerformanceLogger.java"
    }
  ]
}
