UNPKG

764 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var Tag;
4(function (Tag) {
5 Tag["Path"] = "path";
6 Tag["RequestMethod"] = "request_method";
7 Tag["ResponseCode"] = "response_code";
8 Tag["ResponseType"] = "response_type";
9})(Tag = exports.Tag || (exports.Tag = {}));
10function tagsForRequest(ctx) {
11 var _a;
12 return _a = {},
13 _a[Tag.Path] = ctx.path,
14 _a[Tag.RequestMethod] = ctx.request.method,
15 _a;
16}
17exports.tagsForRequest = tagsForRequest;
18function tagsForResponse(ctx) {
19 var _a;
20 return _a = {},
21 _a[Tag.ResponseCode] = "" + ctx.response.status,
22 _a[Tag.ResponseType] = Math.floor(ctx.response.status / 100) + "xx",
23 _a;
24}
25exports.tagsForResponse = tagsForResponse;