Skip to content

Commit

Permalink
remove int64-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
rochdev committed Jan 30, 2025
1 parent 6cc93dd commit 1459c81
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 23 deletions.
1 change: 0 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ dev,get-port,MIT,Copyright Sindre Sorhus
dev,glob,ISC,Copyright Isaac Z. Schlueter and Contributors
dev,globals,MIT,Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)
dev,graphql,MIT,Copyright 2015 Facebook Inc.
dev,int64-buffer,MIT,Copyright 2015-2016 Yusuke Kawasaki
dev,jszip,MIT,Copyright 2015-2016 Stuart Knightley and contributors
dev,knex,MIT,Copyright (c) 2013-present Tim Griesser
dev,mkdirp,MIT,Copyright 2010 James Halliday
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
"glob": "^7.1.6",
"globals": "^15.10.0",
"graphql": "0.13.2",
"int64-buffer": "^0.1.9",
"jszip": "^3.5.0",
"knex": "^2.4.2",
"mkdirp": "^3.0.1",
Expand Down
9 changes: 4 additions & 5 deletions packages/datadog-plugin-net/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const dns = require('dns')
const agent = require('../../dd-trace/test/plugins/agent')
const { expectSomeSpan } = require('../../dd-trace/test/plugins/helpers')
const { Int64BE } = require('int64-buffer') // TODO remove dependency
const { ERROR_MESSAGE, ERROR_TYPE, ERROR_STACK } = require('../../dd-trace/src/constants')

describe('Plugin', () => {
Expand Down Expand Up @@ -66,7 +65,7 @@ describe('Plugin', () => {
'span.kind': 'client',
'ipc.path': '/tmp/dd-trace.sock'
},
parent_id: new Int64BE(parent.context()._spanId._buffer)
parent_id: BigInt(parent.context()._spanId.toString(10))
}).then(done).catch(done)

tracer.scope().activate(parent, () => {
Expand Down Expand Up @@ -121,7 +120,7 @@ describe('Plugin', () => {
'tcp.remote.port': port,
'tcp.local.port': socket.localPort
},
parent_id: new Int64BE(parent.context()._spanId._buffer)
parent_id: BigInt(parent.context()._spanId.toString(10))
}, 2000).then(done).catch(done)
})
})
Expand Down Expand Up @@ -152,7 +151,7 @@ describe('Plugin', () => {
'tcp.remote.port': port,
'tcp.local.port': socket.localPort
},
parent_id: new Int64BE(parent.context()._spanId._buffer)
parent_id: BigInt(parent.context()._spanId.toString(10))
}).then(done).catch(done)
})
})
Expand All @@ -168,7 +167,7 @@ describe('Plugin', () => {
'span.kind': 'client',
'ipc.path': '/tmp/dd-trace.sock'
},
parent_id: new Int64BE(parent.context()._spanId._buffer)
parent_id: BigInt(parent.context()._spanId.toString(10))
}).then(done).catch(done)

tracer.scope().activate(parent, () => {
Expand Down
9 changes: 4 additions & 5 deletions packages/dd-trace/test/datastreams/processor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require('../setup/tap')

const { hostname } = require('os')
const Uint64 = require('int64-buffer').Uint64BE

const { LogCollapsingLowestDenseDDSketch } = require('@datadog/sketches-js')

Expand Down Expand Up @@ -66,8 +65,8 @@ describe('StatsPoint', () => {
payloadSize.accept(100)

const encoded = aggStats.encode()
expect(encoded.Hash.toString()).to.equal(new Uint64(DEFAULT_CURRENT_HASH).toString())
expect(encoded.ParentHash.toString()).to.equal(new Uint64(DEFAULT_PARENT_HASH).toString())
expect(encoded.Hash.toString(16)).to.equal(DEFAULT_CURRENT_HASH.toString('hex'))
expect(encoded.ParentHash.toString(16)).to.equal(DEFAULT_PARENT_HASH.toString('hex'))
expect(encoded.EdgeTags).to.deep.equal(aggStats.edgeTags)
expect(encoded.EdgeLatency).to.deep.equal(edgeLatency.toProto())
expect(encoded.PathwayLatency).to.deep.equal(pathwayLatency.toProto())
Expand Down Expand Up @@ -278,8 +277,8 @@ describe('DataStreamsProcessor', () => {
payloadSize.accept(mockCheckpoint.payloadSize)

const encoded = checkpointBucket.encode()
expect(encoded.Hash.toString()).to.equal(new Uint64(DEFAULT_CURRENT_HASH).toString())
expect(encoded.ParentHash.toString()).to.equal(new Uint64(DEFAULT_PARENT_HASH).toString())
expect(encoded.Hash.toString(16)).to.equal(DEFAULT_CURRENT_HASH.toString('hex'))
expect(encoded.ParentHash.toString(16)).to.equal(DEFAULT_PARENT_HASH.toString('hex'))
expect(encoded.EdgeTags).to.deep.equal(mockCheckpoint.edgeTags)
expect(encoded.EdgeLatency).to.deep.equal(edgeLatency.toProto())
expect(encoded.PathwayLatency).to.deep.equal(pathwayLatency.toProto())
Expand Down
5 changes: 2 additions & 3 deletions packages/dd-trace/test/dd-trace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require('./setup/tap')

const Uint64BE = require('int64-buffer').Uint64BE
const agent = require('./plugins/agent')

const { SAMPLING_PRIORITY_KEY, DECISION_MAKER_KEY } = require('../src/constants')
Expand Down Expand Up @@ -34,8 +33,8 @@ describe('dd-trace', () => {
expect(payload[0][0].service).to.equal('test')
expect(payload[0][0].name).to.equal('hello')
expect(payload[0][0].resource).to.equal('/hello/:name')
expect(payload[0][0].start).to.be.instanceof(Uint64BE)
expect(payload[0][0].duration).to.be.instanceof(Uint64BE)
expect(typeof payload[0][0].start).to.equal('bigint')
expect(typeof payload[0][0].duration).to.equal('bigint')
expect(payload[0][0].metrics).to.have.property(SAMPLING_PRIORITY_KEY)
expect(payload[0][0].meta).to.have.property(DECISION_MAKER_KEY)
})
Expand Down
4 changes: 1 addition & 3 deletions packages/dd-trace/test/plugins/helpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict'

const { Int64BE } = require('int64-buffer') // TODO remove dependency

const { AssertionError } = require('assert')
const { AsyncResource } = require('../../../datadog-instrumentations/src/helpers/instrument')

Expand Down Expand Up @@ -47,7 +45,7 @@ function deepInclude (expected, actual, path = []) {
for (const propName in expected) {
path.push(propName.includes('.') ? `['${propName}']` : propName)
if (isObject(expected[propName]) && isObject(actual[propName])) {
if (expected[propName] instanceof Int64BE) {
if (typeof expected[propName] === 'bigint') {
deepInclude(expected[propName].toString(), actual[propName].toString(), path)
} else {
deepInclude(expected[propName], actual[propName], path)
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2973,11 +2973,6 @@ ink@^3.2.0:
ws "^7.5.5"
yoga-layout-prebuilt "^1.9.6"

int64-buffer@^0.1.9:
version "0.1.10"
resolved "https://registry.npmjs.org/int64-buffer/-/int64-buffer-0.1.10.tgz"
integrity sha512-v7cSY1J8ydZ0GyjUHqF+1bshJ6cnEVLo9EnjB8p+4HDRPZc9N5jjmvUV7NvEsqQOKyH0pmIBFWXVQbiS0+OBbA==

internal-slot@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802"
Expand Down

0 comments on commit 1459c81

Please sign in to comment.