)]}'
{
  "commit": "8a7358d1686588689ef59e61e3382115c0cc301f",
  "tree": "2611408e0009510331582edf0929522c701ca737",
  "parents": [
    "cd2df34ff7e5aa78e2fea95e961a1d01771df384"
  ],
  "author": {
    "name": "Jonathan Amsterdam",
    "email": "jba@google.com",
    "time": "Sun Jun 06 17:15:04 2021 -0400"
  },
  "committer": {
    "name": "Jonathan Amsterdam",
    "email": "jba@google.com",
    "time": "Thu Jun 10 11:49:57 2021 +0000"
  },
  "message": "event: WIP: another try at metrics\n\nThe code that is recording the metric is the best place to describe\nthat metric. For example, an RPC layer knows that number of sent RPCs\nis a counter, and that bytes received is a distribution.\n\nWe want to keep that information separate from the actual metric\nrecoding, both to avoid duplication and to amortize any costs\ninvolved.\n\nThe idea in this CL is to have a lightweight representation for\nmetrics. The world seems to have converged on just three kinds:\ncounter, gauge and distribution in the terminology of this CL.\n\nA package must first create the metrics it wants to record, by calling\nNewMetric with the metric kind, a name, and a description. We create a\nnamespace for the metric using the import path of the caller of\nNewMetric.  That can be overridden, but not to the empty string. By\nforcing a non-empty the namespace we can prevent ambiguous metric\nnames, such has having many packages use the name \"call_count\".\n\nIt\u0027s up to the package whether it creates the metrics globally and\nunconditionally, or each time a value of a certain type is created. A\ncache that has just one global instance would use the former, while\nand RPC package with a Client type would ask the caller of NewClient\nto pass a namespace, and store the created metrics in the Client.\n\nBuilder.Metric records a metric value as before. Its first argument is\none of the previously created metrics, from which it can extract\nwhatever values it needs to build an Event. Its second argument is an\nevent.Value, allowing any type to be a metric value.\n\nWe provide convenience functions for two common cases: Count for\nmarking a single instance of an event, like an RPC call or cache\nprobe; and Since for recording the latency since a start time.\n\nUnits are a necessary annoyance that we don\u0027t fully deal with here.\nFor time we use time.Duration, which lets the exporter choose the unit\nand correctly convert values.\n\nChange-Id: I26d0ac095fa2cd8b19201edc47350704636de89c\nReviewed-on: https://go-review.googlesource.com/c/exp/+/325490\nTrust: Jonathan Amsterdam \u003cjba@google.com\u003e\nRun-TryBot: Jonathan Amsterdam \u003cjba@google.com\u003e\nTryBot-Result: Go Bot \u003cgobot@golang.org\u003e\nReviewed-by: Ian Cottrell \u003ciancottrell@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9043530091b6028736a810be879a9fc834eea7f8",
      "old_mode": 33188,
      "old_path": "event/bench/event_test.go",
      "new_id": "76c0c9c090e1c8a05b02d05e6622913ec80c39db",
      "new_mode": 33188,
      "new_path": "event/bench/event_test.go"
    },
    {
      "type": "modify",
      "old_id": "dda25f0df9fd8acd25522563b0c79a6e85c4872c",
      "old_mode": 33188,
      "old_path": "event/builder.go",
      "new_id": "0d904412f34ea105618817adbe1ec9847466037c",
      "new_mode": 33188,
      "new_path": "event/builder.go"
    },
    {
      "type": "modify",
      "old_id": "e3fbe160f195c1430426ac2115eda6f487f5f645",
      "old_mode": 33188,
      "old_path": "event/common.go",
      "new_id": "f7b426e6a0addb593b9b2f76f5fef158f7e110d7",
      "new_mode": 33188,
      "new_path": "event/common.go"
    },
    {
      "type": "modify",
      "old_id": "1bbb4e3b346965212f851320175a9445f5b80956",
      "old_mode": 33188,
      "old_path": "event/common_test.go",
      "new_id": "a3658c72397dd4a83c45bc19df4f66d30b40f1ca",
      "new_mode": 33188,
      "new_path": "event/common_test.go"
    },
    {
      "type": "modify",
      "old_id": "e92943859792a99f27276edaf27fd7bc7c910c2c",
      "old_mode": 33188,
      "old_path": "event/event_test.go",
      "new_id": "cf6e0cb9784347426ba52d979f3725d2b4389eb6",
      "new_mode": 33188,
      "new_path": "event/event_test.go"
    },
    {
      "type": "modify",
      "old_id": "e15cd2dce7df85272c5459f53007f46a1638bd90",
      "old_mode": 33188,
      "old_path": "event/export.go",
      "new_id": "84af70c7e6f1ee1c0b84b9015333c2a27ce85815",
      "new_mode": 33188,
      "new_path": "event/export.go"
    },
    {
      "type": "modify",
      "old_id": "a8673109c8f6972b8587ba809803a31beb89795d",
      "old_mode": 33188,
      "old_path": "event/label.go",
      "new_id": "71c65fa36665a306020326a42d37c5d5d9c90b00",
      "new_mode": 33188,
      "new_path": "event/label.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6e30323b6a91968f7747e95dc1ca1f1ff260daef",
      "new_mode": 33188,
      "new_path": "event/metric.go"
    }
  ]
}
