Skip to content

Commit

Permalink
[pinpoint-apm#98] Fix no details error case informations to Error ca…
Browse files Browse the repository at this point in the history
…llstack

By using the string return value of the stack in the toString method of Error, the developer can check the error information in detail.
Fix redis 4.0 redis connection error
   - upgrade testcontainer to v7
  • Loading branch information
feelform committed Dec 3, 2021
1 parent 1e0ec73 commit 9a243d1
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 111 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:

name: Node ${{ matrix.node_version }} on ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: setup node environment
uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion .nycrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"exclude": ["lib/data/grpc/**/*", "test/**/*"]
"exclude": ["lib/data/v1/**/*", "test/**/*"]
}
3 changes: 2 additions & 1 deletion lib/context/span-event-recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ class SpanEventRecorder {
recordException(error, isError) {
if (this.spanEvent && error) {
const metaInfo = StringMetaService.get(error.name || 'Error')
const errorMessage = error && typeof error.stack === 'string' ? error.stack.split(/\r?\n/, 2).join() : ''
this.spanEvent.exceptionInfo = {
intValue: metaInfo.stringId,
stringValue: error.toString(),
stringValue: errorMessage,
}
if (this.span && isError) {
this.span.err = 1
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pinpoint-node-agent",
"version": "0.9.0-next.1",
"version": "0.9.0-next.2",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/tape ./test/**/*.test.js",
Expand Down Expand Up @@ -86,13 +86,13 @@
"mongoose": "^5.4.3",
"npm-run-all": "^1.7.0",
"nyc": "^15.1.0",
"redis": ">=3.1.1",
"redis": "^3.1.2",
"redis-mock": "^0.49.0",
"request": "^2.88.0",
"rewire": "^4.0.1",
"rimraf": "^2.6.2",
"tap-spec": "^5.0.0",
"tape": "^4.9.1",
"testcontainers": "^2.8.0"
"testcontainers": "^7.24.0"
}
}
2 changes: 1 addition & 1 deletion test/agent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ test('Should initialize agent', function (t) {

const agent = require('./support/agent-singleton-mock')
t.ok(agent)
t.equal(agent.pinpointClient.agentInfo.agentVersion, '0.9.0-next.1', 'agent version from package.json')
t.equal(agent.pinpointClient.agentInfo.agentVersion, '0.9.0-next.2', 'agent version from package.json')
})
2 changes: 1 addition & 1 deletion test/instrumentation/fix-async-call-stack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test(`fix redis call stack depth`, async (t) => {
const redis = require('redis')
const client = redis.createClient(
container.getMappedPort(6379),
container.getContainerIpAddress(),
container.getHost(),
)

client.set("key", "value", async function (error) {
Expand Down
280 changes: 192 additions & 88 deletions test/instrumentation/module/express.test.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions test/instrumentation/module/fix-redis.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test(`redis destination id`, async (t) => {

const client = redis.createClient(
container.getMappedPort(6379),
container.getContainerIpAddress(),
container.getHost(),
)

client.on("error", function (error) {
Expand Down Expand Up @@ -65,7 +65,7 @@ test("ioredis destination id", async function (t) {
const port = container.getMappedPort(6379)
const redis = new Redis(
port,
container.getContainerIpAddress(),
container.getHost(),
)
redis.on("error", function (error) {
console.error(error)
Expand Down Expand Up @@ -119,7 +119,7 @@ test(`Fix app crash without callback function https://github.com/pinpoint-apm/pi
const redis = require('redis')

const client = redis.createClient({
host: container.getContainerIpAddress(),
host: container.getHost(),
port: container.getMappedPort(6379),
db: 3,
})
Expand Down
4 changes: 2 additions & 2 deletions test/instrumentation/module/http.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ test(`outgoing request URL escape a bug`, async (t) => {
t.true(agent.dataSender.mockSpanChunk.spanEventList.length == 2, `spanEventList`)

const spanEvent = agent.dataSender.mockSpanChunk.spanEventList[1]

t.equal(spanEvent.annotations[0].value.stringValue, "GET", "URL")
t.equal(spanEvent.annotations[1].value.stringValue, "eonet.sci.gsfc.nasa.gov/api/v2.1/categories", "URL")
t.equal(spanEvent.annotations[1].value.stringValue, "eonet.gsfc.nasa.gov/api/v2.1/categories", "URL")
agent.completeTraceObject(trace)
})
})
20 changes: 10 additions & 10 deletions test/instrumentation/module/mongodb-core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test(`mongodb`, async (t) => {
const trace = agent.createTraceObject()
const Server = require('mongodb-core').Server
var server = new Server({
host: container.getContainerIpAddress(),
host: container.getHost(),
port: container.getMappedPort(27017),
reconnect: true,
reconnectInterval: 50
Expand All @@ -44,27 +44,27 @@ test(`mongodb`, async (t) => {
},
ordered: true
}, async function (err, results) {
t.equal(null, err);
t.equal(2, results.result.n);
t.equal(null, err)
t.equal(2, results.result.n)

server.destroy()
await container.stop()
agent.completeTraceObject(trace)
t.end()
});
});
});
})
})
})

server.on('close', function () {
console.log('mongodb-core.test.js closed')
t.end()
});
})

server.on('reconnect', function () {
console.log('mongodb-core.test.js reconnect');
});
console.log('mongodb-core.test.js reconnect')
})

// Start connection
server.connect();
server.connect()

})

3 comments on commit 9a243d1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

77.39%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
lib
   agent.js74.70%62.50%75%78.18%130, 130, 130–134, 136, 140, 142–143, 29–32, 57–58, 79
   config.js92.35%88.89%100%92.31%105, 150–151, 169–171, 175, 178, 182–183, 189, 211, 221
lib/client
   data-sender-factory.js100%100%100%100%
   data-sender.js49.15%36.36%42.86%60%24, 28, 28, 28–29, 39, 41, 41, 41–43, 43, 43–44, 49, 49, 49–50, 55, 55, 55–56, 61, 61, 61–62
   grpc-bidirectional-stream.js66.67%42.11%100%78.95%17, 17, 17–18, 22, 22–23, 27, 27, 27–28, 32, 32, 32–33
   grpc-client-side-stream.js73.13%57.14%87.50%83.87%22–23, 25–27, 38, 38, 38, 38, 38, 38–39, 43, 43, 43–44, 65
   grpc-data-sender.js73.44%51.72%92%80.73%113–114, 117, 126, 126, 126–127, 137–138, 144, 152–153, 159, 168–169, 173, 173, 173, 173, 173–174, 182–183, 187, 187, 187, 187, 187–188, 196–197, 201, 201, 201, 201, 201–202, 208–209, 209, 209–210, 212, 217–218, 81–82, 90–91
   grpc-stream.js95.18%88.89%100%97.83%37–38, 78, 96
   grpc-unary-rpc.js97.44%90.91%100%100%36
   pinpoint-client.js58.33%100%33.33%66.67%20, 23, 27
lib/constant
   annotation-key.js100%100%100%100%
   annotation.js100%100%100%100%
   commaned-type.js100%100%100%100%
   http-header.js100%100%100%100%
   method-descriptor.js100%100%100%100%
   method-type.js100%100%100%100%
   service-type.js100%100%100%100%
   valued-type.js100%100%100%100%
lib/context
   annotation-key-utils.js23.08%9.09%100%28.57%14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36
   annotation-key.js94.74%66.67%100%100%21
   annotation.js100%100%100%100%
   api-meta-service.js95.83%87.50%100%97.06%30, 64
   async-id-accessor.js71.43%100%50%80%10
   async-id.js100%100%100%100%
   async-method-descriptor.js100%100%100%100%
   async-trace.js91.67%75%83.33%94.74%53, 66–67
   buffered-storage.js93.88%76.92%100%100%23, 34, 63
   context-manager.js94.44%75%100%100%15, 28
   disable-async-trace.js25%100%0%50%13, 21
   disable-span-event-recorder.js33.33%0%25%50%36, 36, 36–38, 40, 42, 70
   disable-trace.js43.75%0%44.44%62.50%33, 33, 33–35, 40, 40, 40–41, 50, 50, 50, 50
   express-method-descriptor-builder.js71.43%50%100%75%11–12
   id-generator.js100%100%100%100%
   make-method-descriptor-builder.js97.44%96.43%100%97.56%19–20
   method-descriptor-builder.js83.68%84.06%82.14%83.87%120–121, 128–129, 131, 131–132, 140–141, 184–185, 188–189, 207–208, 28, 31, 45, 67, 71, 75–76, 80–81, 90–91
   method-descriptor.js91.11%100%84.62%92.31%43, 47
   sequence-generator.js86.67%75%100%87.50%17–18
   service-type.js75%40%100%80%24, 26, 26, 31–32, 37–38
   span-chunk.js91.53%70%100%95%15–16, 58, 68–69
   span-event-recorder.js62.22%50.85%72.22%70.69%101, 108, 114, 114, 114, 114, 114–116, 121, 127, 127, 127, 127, 127–128, 128, 128–129, 129, 129, 129, 129–130, 134, 134, 134, 134, 134–136, 142, 27, 31, 37, 43, 49, 55–56, 61, 65, 71, 78–81
   span-event.js92.31%80%100%96%10–11, 36
   span-events.js95.56%87.50%100%96.67%22, 25
   span-recorder.js64.56%56.10%80%71.43%19, 25, 31–34, 43, 49, 55, 61, 67, 67, 67, 67, 67–68, 68, 68–69, 73, 78, 78, 78, 78, 78–79
   span.js94.67%72.73%100%98.31%15–16, 46, 61
   string-meta-service.js34.48%0%50%38.10%25, 25, 25, 27–28, 28, 28–33, 35, 39–40, 42, 44
   trace-context.js93.48%91.30%100%93.22%26–27, 68–69, 84, 97
   trace-id.js100%100%100%100%
   trace.js63.11%41.38%75%70.97%100, 102–103, 107, 107, 107, 107, 107, 109–111, 119, 119, 119, 119, 52–53, 57–59, 62, 64, 67–68, 68, 68, 68, 68–70, 84, 91, 97–99
   transaction-id.js88.89%80%100%92.86%30, 32, 36
lib/data
   grpc-data-convertor.js60.85%50.85%69.57%62.81%107–108, 118–119, 130, 130, 130, 130, 130–131, 136, 136, 136–137, 139–148, 150–151, 155–156, 16, 164–165, 17, 181–182, 191–192, 198, 198, 198–199, 201, 203–205, 207–210, 214, 217–218, 220–223, 239, 241–242, 242, 242, 242, 242, 242–243, 246–247, 251–252, 32–33, 51–52, 61, 61, 61–62, 64–67, 69, 69, 69–71, 74–85, 87–88, 90–91, 95–96
   typed-value.js53.33%40%66.67%59.26%15, 15, 15, 20–21, 26, 26, 26–27, 29, 31–32, 37, 45–47, 49, 49, 49–50
lib/data/dto
   agent-info.js95.24%0%100%100%14
   api-meta-info.js95.65%88.89%100%100%10
   string-meta-info.js85.71%0%100%100%10
lib/instrumentation
   http-shared.js75.31%60.38%92.31%81.25%109–110, 140, 143, 143, 143–144, 144, 144–145, 147, 147, 147–148, 150, 158, 37–38, 40–41, 56, 67–68, 68, 68, 68, 68–69, 69, 69–70, 72, 74, 91–92, 92, 92–93, 95
   module-hook.js82.46%66.67%100%83.33%38, 43, 51–52, 55, 68, 94, 94, 94–95
   request-data.js100%100%100%100%
   request-header-utils.js87.63%74.19%100%93.33%19–20, 29, 35, 51, 53, 58, 73–74, 84–85, 89
lib/instrumentation/module
   express.js36.46%24.21%47.62%42.24%103–104, 106, 106, 106–107, 109, 120, 120, 120–123, 123, 123, 123, 123–124, 126, 137–141, 141, 141–146, 146, 146–147, 149, 152, 152, 152–155, 158–159, 159, 159–160, 160, 160–161, 163, 165, 171, 171, 171–172, 195, 195, 195–196, 200, 200, 200–201, 203, 203, 203–204, 206, 206, 206, 206, 206–208, 210, 214, 214, 214–215, 217, 221–223, 225, 225, 225–227, 229, 229, 229–230, 230, 230, 230, 230–232, 232, 232–233, 235, 238, 238, 238–241, 244–245, 245, 245–246, 246, 246–247, 249, 251, 256–259, 261, 261, 261, 261, 261–266, 266, 266–267, 269, 27, 272–273, 273, 273–274, 276–277, 28–29, 32–33, 48, 48, 48–49, 53, 53, 53, 60, 60, 60, 60–62, 71, 80, 85, 94
   http.js100%100%100%100%
   https.js94.12%80%100%100%19
   koa-router.js25%6.25%28.57%31.11%17–19, 28, 28, 28, 32–35, 40–41, 41, 41–43, 43, 43, 45–46, 46, 46–50, 50, 50–53, 55, 57, 57, 57–61, 63, 65, 65, 65–66, 69, 74
   redis.js89.86%76.19%100%95.35%17–19, 32, 34, 53, 65
lib/metric
   active-trace-histogram.js6.90%0%0%11.76%13, 13, 13–18, 22, 22, 22–23, 26, 26, 26–28, 28, 28–30, 30, 30–31, 33
   active-trace.js65.45%64.29%57.14%67.65%26–27, 46–47, 51, 53, 53, 53–54, 57–58, 58, 58–60, 63
   agent-stats-monitor.js14.29%0%0%21.05%15–18, 22, 26, 26, 26–27, 29–31, 33–35, 38, 44
   histogram-schema.js100%100%100%100%
   ping-scheduler.js12.50%0%0%18.18%12–15, 17–18, 22, 22, 22–23, 25
   resource-stats-collector.js20%25%0%25%10, 18–19, 23, 30–31, 38–39, 41–45, 47, 47, 47, 49, 51
   v8-compatibility.js95.24%100%100%92.86%21
lib/sampler
   sampler.js60.87%37.50%100%69.23%17, 20, 20, 20–21, 21, 21–22, 24
   sampling-flag.js55.56%16.67%100%70%16, 20, 20, 20, 20, 20–21, 23
lib/utils
   ant-path-matcher.js84.59%79.82%86.36%87.36%107, 107, 109, 124, 126–127, 127, 127–128, 131, 166–167, 175–176, 219, 225, 237–238, 242, 252, 257, 272, 276, 302, 304, 307–311, 324, 330–331, 335, 42–44, 55, 55, 55, 55, 55–56, 58, 92–93
   convert-utils.js47.37%25%50%66.67%10–11, 11–12, 12, 17–18, 21–22
   logger.js78.05%70%88.89%77.27%25, 25, 25–27, 29, 37–38
   scheduler.js78.85%64.29%90.91%81.48%15, 22–24, 26–27, 50–52, 60
   simple-cache.js66.67%68.75%55.56%69.57%30, 32–33, 40–41, 41, 41–43, 48, 53, 57
   string-utils.js66.67%100%0%100%

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

77.30%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
lib
   agent.js74.70%62.50%75%78.18%130, 130, 130–134, 136, 140, 142–143, 29–32, 57–58, 79
   config.js92.35%88.89%100%92.31%105, 150–151, 169–171, 175, 178, 182–183, 189, 211, 221
lib/client
   data-sender-factory.js100%100%100%100%
   data-sender.js49.15%36.36%42.86%60%24, 28, 28, 28–29, 39, 41, 41, 41–43, 43, 43–44, 49, 49, 49–50, 55, 55, 55–56, 61, 61, 61–62
   grpc-bidirectional-stream.js66.67%42.11%100%78.95%17, 17, 17–18, 22, 22–23, 27, 27, 27–28, 32, 32, 32–33
   grpc-client-side-stream.js73.13%57.14%87.50%83.87%22–23, 25–27, 38, 38, 38, 38, 38, 38–39, 43, 43, 43–44, 65
   grpc-data-sender.js73.44%51.72%92%80.73%113–114, 117, 126, 126, 126–127, 137–138, 144, 152–153, 159, 168–169, 173, 173, 173, 173, 173–174, 182–183, 187, 187, 187, 187, 187–188, 196–197, 201, 201, 201, 201, 201–202, 208–209, 209, 209–210, 212, 217–218, 81–82, 90–91
   grpc-stream.js95.18%88.89%100%97.83%37–38, 78, 96
   grpc-unary-rpc.js97.44%90.91%100%100%36
   pinpoint-client.js58.33%100%33.33%66.67%20, 23, 27
lib/constant
   annotation-key.js100%100%100%100%
   annotation.js100%100%100%100%
   commaned-type.js100%100%100%100%
   http-header.js100%100%100%100%
   method-descriptor.js100%100%100%100%
   method-type.js100%100%100%100%
   service-type.js100%100%100%100%
   valued-type.js100%100%100%100%
lib/context
   annotation-key-utils.js23.08%9.09%100%28.57%14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36
   annotation-key.js94.74%66.67%100%100%21
   annotation.js100%100%100%100%
   api-meta-service.js95.83%87.50%100%97.06%30, 64
   async-id-accessor.js71.43%100%50%80%10
   async-id.js100%100%100%100%
   async-method-descriptor.js100%100%100%100%
   async-trace.js91.67%75%83.33%94.74%53, 66–67
   buffered-storage.js93.88%76.92%100%100%23, 34, 63
   context-manager.js97.22%87.50%100%100%28
   disable-async-trace.js25%100%0%50%13, 21
   disable-span-event-recorder.js33.33%0%25%50%36, 36, 36–38, 40, 42, 70
   disable-trace.js43.75%0%44.44%62.50%33, 33, 33–35, 40, 40, 40–41, 50, 50, 50, 50
   express-method-descriptor-builder.js71.43%50%100%75%11, 14
   id-generator.js100%100%100%100%
   make-method-descriptor-builder.js97.44%96.43%100%97.56%19–20
   method-descriptor-builder.js81.05%84.06%78.57%79.57%120–121, 128–129, 131, 131–132, 140–141, 171–174, 184–185, 188–189, 207–208, 28, 31, 45, 67, 71, 75–76, 80–81, 90–91
   method-descriptor.js91.11%100%84.62%92.31%43, 47
   sequence-generator.js86.67%75%100%87.50%17–18
   service-type.js75%40%100%80%24, 26, 26, 31–32, 37–38
   span-chunk.js91.53%70%100%95%15–16, 58, 68–69
   span-event-recorder.js62.22%50.85%72.22%70.69%101, 108, 114, 114, 114, 114, 114–116, 121, 127, 127, 127, 127, 127–128, 128, 128–129, 129, 129, 129, 129–130, 134, 134, 134, 134, 134–136, 142, 27, 31, 37, 43, 49, 55–56, 61, 65, 71, 78–81
   span-event.js92.31%80%100%96%10–11, 36
   span-events.js95.56%87.50%100%96.67%22, 25
   span-recorder.js64.56%56.10%80%71.43%19, 25, 31–34, 43, 49, 55, 61, 67, 67, 67, 67, 67–68, 68, 68–69, 73, 78, 78, 78, 78, 78–79
   span.js94.67%72.73%100%98.31%15–16, 46, 61
   string-meta-service.js34.48%0%50%38.10%25, 25, 25, 27–28, 28, 28–33, 35, 39–40, 42, 44
   trace-context.js93.48%91.30%100%93.22%26–27, 68–69, 84, 97
   trace-id.js100%100%100%100%
   trace.js63.11%41.38%75%70.97%100, 102–103, 107, 107, 107, 107, 107, 109–111, 119, 119, 119, 119, 52–53, 57–59, 62, 64, 67–68, 68, 68, 68, 68–70, 84, 91, 97–99
   transaction-id.js88.89%80%100%92.86%30, 32, 36
lib/data
   grpc-data-convertor.js60.85%50.85%69.57%62.81%107–108, 118–119, 130, 130, 130, 130, 130–131, 136, 136, 136–137, 139–148, 150–151, 155–156, 16, 164–165, 17, 181–182, 191–192, 198, 198, 198–199, 201, 203–205, 207–210, 214, 217–218, 220–223, 239, 241–242, 242, 242, 242, 242, 242–243, 246–247, 251–252, 32–33, 51–52, 61, 61, 61–62, 64–67, 69, 69, 69–71, 74–85, 87–88, 90–91, 95–96
   typed-value.js53.33%40%66.67%59.26%15, 15, 15, 20–21, 26, 26, 26–27, 29, 31–32, 37, 45–47, 49, 49, 49–50
lib/data/dto
   agent-info.js95.24%0%100%100%14
   api-meta-info.js95.65%88.89%100%100%10
   string-meta-info.js85.71%0%100%100%10
lib/instrumentation
   http-shared.js75.31%60.38%92.31%81.25%109–110, 140, 143, 143, 143–144, 144, 144–145, 147, 147, 147–148, 150, 158, 37–38, 40–41, 56, 67–68, 68, 68, 68, 68–69, 69, 69–70, 72, 74, 91–92, 92, 92–93, 95
   module-hook.js82.46%66.67%100%83.33%38, 43, 51–52, 55, 68, 94, 94, 94–95
   request-data.js100%100%100%100%
   request-header-utils.js87.63%74.19%100%93.33%19–20, 29, 35, 51, 53, 58, 73–74, 84–85, 89
lib/instrumentation/module
   express.js37.55%24.21%52.38%43.48%104, 106, 106, 106–107, 109, 113, 120, 120, 120–123, 123, 123, 123, 123–124, 126, 130, 137–141, 141, 141–146, 146, 146–147, 149, 152, 152, 152–155, 158–159, 159, 159–160, 160, 160–161, 163, 165, 171, 171, 171–172, 195, 195, 195–196, 200, 200, 200–201, 203, 203, 203–204, 206, 206, 206, 206, 206–208, 210, 214, 214, 214–215, 217, 221–223, 225, 225, 225–227, 229, 229, 229–230, 230, 230, 230, 230–232, 232, 232–233, 235, 238, 238, 238–241, 244–245, 245, 245–246, 246, 246–247, 249, 251, 256–259, 261, 261, 261, 261, 261–266, 266, 266–267, 269, 27, 272–273, 273, 273–274, 276–277, 28–29, 32–33, 48, 53, 53, 53, 60, 60, 60, 60–62, 71, 80, 85, 94
   http.js100%100%100%100%
   https.js94.12%80%100%100%19
   koa-router.js25%6.25%28.57%31.11%17–19, 28, 28, 28, 32–35, 40–41, 41, 41–43, 43, 43, 45–46, 46, 46–50, 50, 50–53, 55, 57, 57, 57–61, 63, 65, 65, 65–66, 69, 74
   redis.js89.86%76.19%100%95.35%17–19, 32, 34, 53, 65
lib/metric
   active-trace-histogram.js6.90%0%0%11.76%13, 13, 13–18, 22, 22, 22–23, 26, 26, 26–28, 28, 28–30, 30, 30–31, 33
   active-trace.js65.45%64.29%57.14%67.65%26–27, 46–47, 51, 53, 53, 53–54, 57–58, 58, 58–60, 63
   agent-stats-monitor.js14.29%0%0%21.05%15–18, 22, 26, 26, 26–27, 29–31, 33–35, 38, 44
   histogram-schema.js100%100%100%100%
   ping-scheduler.js12.50%0%0%18.18%12–15, 17–18, 22, 22, 22–23, 25
   resource-stats-collector.js20%25%0%25%10, 18–19, 23, 30–31, 38–39, 41–45, 47, 47, 47, 49, 51
   v8-compatibility.js95.24%100%100%92.86%21
lib/sampler
   sampler.js60.87%37.50%100%69.23%17, 20, 20, 20–21, 21, 21–22, 24
   sampling-flag.js55.56%16.67%100%70%16, 20, 20, 20, 20, 20–21, 23
lib/utils
   ant-path-matcher.js84.59%79.82%86.36%87.36%107, 107, 109, 124, 126–127, 127, 127–128, 131, 166–167, 175–176, 219, 225, 237–238, 242, 252, 257, 272, 276, 302, 304, 307–311, 324, 330–331, 335, 42–44, 55, 55, 55, 55, 55–56, 58, 92–93
   convert-utils.js47.37%25%50%66.67%10–11, 11–12, 12, 17–18, 21–22
   logger.js78.05%70%88.89%77.27%25, 25, 25–27, 29, 37–38
   scheduler.js78.85%64.29%90.91%81.48%15, 22–24, 26–27, 50–52, 60
   simple-cache.js66.67%68.75%55.56%69.57%30, 32–33, 40–41, 41, 41–43, 48, 53, 57
   string-utils.js66.67%100%0%100%

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

77.39%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
lib
   agent.js74.70%62.50%75%78.18%130, 130, 130–134, 136, 140, 142–143, 29–32, 57–58, 79
   config.js92.35%88.89%100%92.31%105, 150–151, 169–171, 175, 178, 182–183, 189, 211, 221
lib/client
   data-sender-factory.js100%100%100%100%
   data-sender.js49.15%36.36%42.86%60%24, 28, 28, 28–29, 39, 41, 41, 41–43, 43, 43–44, 49, 49, 49–50, 55, 55, 55–56, 61, 61, 61–62
   grpc-bidirectional-stream.js66.67%42.11%100%78.95%17, 17, 17–18, 22, 22–23, 27, 27, 27–28, 32, 32, 32–33
   grpc-client-side-stream.js73.13%57.14%87.50%83.87%22–23, 25–27, 38, 38, 38, 38, 38, 38–39, 43, 43, 43–44, 65
   grpc-data-sender.js73.44%51.72%92%80.73%113–114, 117, 126, 126, 126–127, 137–138, 144, 152–153, 159, 168–169, 173, 173, 173, 173, 173–174, 182–183, 187, 187, 187, 187, 187–188, 196–197, 201, 201, 201, 201, 201–202, 208–209, 209, 209–210, 212, 217–218, 81–82, 90–91
   grpc-stream.js95.18%88.89%100%97.83%37–38, 78, 96
   grpc-unary-rpc.js97.44%90.91%100%100%36
   pinpoint-client.js58.33%100%33.33%66.67%20, 23, 27
lib/constant
   annotation-key.js100%100%100%100%
   annotation.js100%100%100%100%
   commaned-type.js100%100%100%100%
   http-header.js100%100%100%100%
   method-descriptor.js100%100%100%100%
   method-type.js100%100%100%100%
   service-type.js100%100%100%100%
   valued-type.js100%100%100%100%
lib/context
   annotation-key-utils.js23.08%9.09%100%28.57%14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36
   annotation-key.js94.74%66.67%100%100%21
   annotation.js100%100%100%100%
   api-meta-service.js95.83%87.50%100%97.06%30, 64
   async-id-accessor.js71.43%100%50%80%10
   async-id.js100%100%100%100%
   async-method-descriptor.js100%100%100%100%
   async-trace.js91.67%75%83.33%94.74%53, 66–67
   buffered-storage.js93.88%76.92%100%100%23, 34, 63
   context-manager.js94.44%75%100%100%15, 28
   disable-async-trace.js25%100%0%50%13, 21
   disable-span-event-recorder.js33.33%0%25%50%36, 36, 36–38, 40, 42, 70
   disable-trace.js43.75%0%44.44%62.50%33, 33, 33–35, 40, 40, 40–41, 50, 50, 50, 50
   express-method-descriptor-builder.js71.43%50%100%75%11–12
   id-generator.js100%100%100%100%
   make-method-descriptor-builder.js97.44%96.43%100%97.56%19–20
   method-descriptor-builder.js83.68%84.06%82.14%83.87%120–121, 128–129, 131, 131–132, 140–141, 184–185, 188–189, 207–208, 28, 31, 45, 67, 71, 75–76, 80–81, 90–91
   method-descriptor.js91.11%100%84.62%92.31%43, 47
   sequence-generator.js86.67%75%100%87.50%17–18
   service-type.js75%40%100%80%24, 26, 26, 31–32, 37–38
   span-chunk.js91.53%70%100%95%15–16, 58, 68–69
   span-event-recorder.js62.22%50.85%72.22%70.69%101, 108, 114, 114, 114, 114, 114–116, 121, 127, 127, 127, 127, 127–128, 128, 128–129, 129, 129, 129, 129–130, 134, 134, 134, 134, 134–136, 142, 27, 31, 37, 43, 49, 55–56, 61, 65, 71, 78–81
   span-event.js92.31%80%100%96%10–11, 36
   span-events.js95.56%87.50%100%96.67%22, 25
   span-recorder.js64.56%56.10%80%71.43%19, 25, 31–34, 43, 49, 55, 61, 67, 67, 67, 67, 67–68, 68, 68–69, 73, 78, 78, 78, 78, 78–79
   span.js94.67%72.73%100%98.31%15–16, 46, 61
   string-meta-service.js34.48%0%50%38.10%25, 25, 25, 27–28, 28, 28–33, 35, 39–40, 42, 44
   trace-context.js93.48%91.30%100%93.22%26–27, 68–69, 84, 97
   trace-id.js100%100%100%100%
   trace.js63.11%41.38%75%70.97%100, 102–103, 107, 107, 107, 107, 107, 109–111, 119, 119, 119, 119, 52–53, 57–59, 62, 64, 67–68, 68, 68, 68, 68–70, 84, 91, 97–99
   transaction-id.js88.89%80%100%92.86%30, 32, 36
lib/data
   grpc-data-convertor.js60.85%50.85%69.57%62.81%107–108, 118–119, 130, 130, 130, 130, 130–131, 136, 136, 136–137, 139–148, 150–151, 155–156, 16, 164–165, 17, 181–182, 191–192, 198, 198, 198–199, 201, 203–205, 207–210, 214, 217–218, 220–223, 239, 241–242, 242, 242, 242, 242, 242–243, 246–247, 251–252, 32–33, 51–52, 61, 61, 61–62, 64–67, 69, 69, 69–71, 74–85, 87–88, 90–91, 95–96
   typed-value.js53.33%40%66.67%59.26%15, 15, 15, 20–21, 26, 26, 26–27, 29, 31–32, 37, 45–47, 49, 49, 49–50
lib/data/dto
   agent-info.js95.24%0%100%100%14
   api-meta-info.js95.65%88.89%100%100%10
   string-meta-info.js85.71%0%100%100%10
lib/instrumentation
   http-shared.js75.31%60.38%92.31%81.25%109–110, 140, 143, 143, 143–144, 144, 144–145, 147, 147, 147–148, 150, 158, 37–38, 40–41, 56, 67–68, 68, 68, 68, 68–69, 69, 69–70, 72, 74, 91–92, 92, 92–93, 95
   module-hook.js82.46%66.67%100%83.33%38, 43, 51–52, 55, 68, 94, 94, 94–95
   request-data.js100%100%100%100%
   request-header-utils.js87.63%74.19%100%93.33%19–20, 29, 35, 51, 53, 58, 73–74, 84–85, 89
lib/instrumentation/module
   express.js36.46%24.21%47.62%42.24%103–104, 106, 106, 106–107, 109, 120, 120, 120–123, 123, 123, 123, 123–124, 126, 137–141, 141, 141–146, 146, 146–147, 149, 152, 152, 152–155, 158–159, 159, 159–160, 160, 160–161, 163, 165, 171, 171, 171–172, 195, 195, 195–196, 200, 200, 200–201, 203, 203, 203–204, 206, 206, 206, 206, 206–208, 210, 214, 214, 214–215, 217, 221–223, 225, 225, 225–227, 229, 229, 229–230, 230, 230, 230, 230–232, 232, 232–233, 235, 238, 238, 238–241, 244–245, 245, 245–246, 246, 246–247, 249, 251, 256–259, 261, 261, 261, 261, 261–266, 266, 266–267, 269, 27, 272–273, 273, 273–274, 276–277, 28–29, 32–33, 48, 48, 48–49, 53, 53, 53, 60, 60, 60, 60–62, 71, 80, 85, 94
   http.js100%100%100%100%
   https.js94.12%80%100%100%19
   koa-router.js25%6.25%28.57%31.11%17–19, 28, 28, 28, 32–35, 40–41, 41, 41–43, 43, 43, 45–46, 46, 46–50, 50, 50–53, 55, 57, 57, 57–61, 63, 65, 65, 65–66, 69, 74
   redis.js89.86%76.19%100%95.35%17–19, 32, 34, 53, 65
lib/metric
   active-trace-histogram.js6.90%0%0%11.76%13, 13, 13–18, 22, 22, 22–23, 26, 26, 26–28, 28, 28–30, 30, 30–31, 33
   active-trace.js65.45%64.29%57.14%67.65%26–27, 46–47, 51, 53, 53, 53–54, 57–58, 58, 58–60, 63
   agent-stats-monitor.js14.29%0%0%21.05%15–18, 22, 26, 26, 26–27, 29–31, 33–35, 38, 44
   histogram-schema.js100%100%100%100%
   ping-scheduler.js12.50%0%0%18.18%12–15, 17–18, 22, 22, 22–23, 25
   resource-stats-collector.js20%25%0%25%10, 18–19, 23, 30–31, 38–39, 41–45, 47, 47, 47, 49, 51
   v8-compatibility.js95.24%100%100%92.86%21
lib/sampler
   sampler.js60.87%37.50%100%69.23%17, 20, 20, 20–21, 21, 21–22, 24
   sampling-flag.js55.56%16.67%100%70%16, 20, 20, 20, 20, 20–21, 23
lib/utils
   ant-path-matcher.js84.59%79.82%86.36%87.36%107, 107, 109, 124, 126–127, 127, 127–128, 131, 166–167, 175–176, 219, 225, 237–238, 242, 252, 257, 272, 276, 302, 304, 307–311, 324, 330–331, 335, 42–44, 55, 55, 55, 55, 55–56, 58, 92–93
   convert-utils.js47.37%25%50%66.67%10–11, 11–12, 12, 17–18, 21–22
   logger.js78.05%70%88.89%77.27%25, 25, 25–27, 29, 37–38
   scheduler.js78.85%64.29%90.91%81.48%15, 22–24, 26–27, 50–52, 60
   simple-cache.js66.67%68.75%55.56%69.57%30, 32–33, 40–41, 41, 41–43, 48, 53, 57
   string-utils.js66.67%100%0%100%

Please sign in to comment.