apollo-reporting-protobuf
Advanced tools
Comparing version 0.6.2 to 0.6.3-unified.0
@@ -6,2 +6,3 @@ const protobuf = require('./protobuf'); | ||
// than 104 days). | ||
// XXX Just remove this in our fork? | ||
// https://github.com/protobufjs/protobuf.js/issues/1253 | ||
@@ -11,23 +12,2 @@ protobufJS.util.Long = undefined; | ||
// Override the generated protobuf Traces.encode function so that it will look | ||
// for Traces that are already encoded to Buffer as well as unencoded | ||
// Traces. This amortizes the protobuf encoding time over each generated Trace | ||
// instead of bunching it all up at once at sendReport time. In load tests, this | ||
// change improved p99 end-to-end HTTP response times by a factor of 11 without | ||
// a casually noticeable effect on p50 times. This also makes it easier for us | ||
// to implement maxUncompressedReportSize as we know the encoded size of traces | ||
// as we go. | ||
const originalTracesAndStatsEncode = protobuf.TracesAndStats.encode; | ||
protobuf.TracesAndStats.encode = function(message, originalWriter) { | ||
const writer = originalTracesAndStatsEncode(message, originalWriter); | ||
const encodedTraces = message.encodedTraces; | ||
if (encodedTraces != null && encodedTraces.length) { | ||
for (let i = 0; i < encodedTraces.length; ++i) { | ||
writer.uint32(/* id 1, wireType 2 =*/ 10); | ||
writer.bytes(encodedTraces[i]); | ||
} | ||
} | ||
return writer; | ||
}; | ||
module.exports = protobuf; |
{ | ||
"name": "apollo-reporting-protobuf", | ||
"version": "0.6.2", | ||
"version": "0.6.3-unified.0", | ||
"description": "Protobuf format for Apollo usage reporting", | ||
@@ -9,8 +9,6 @@ "main": "dist/index.js", | ||
"clean": "git clean -fdX -- dist", | ||
"prepare": "npm run clean && mkdir dist && npm run prepare:proto && npm run pbjs && npm run pbts && cp src/* dist", | ||
"pbjs": "apollo-pbjs --target static-module --out dist/protobuf.js --wrap commonjs --force-number dist/reports.proto", | ||
"prepare": "npm run clean && mkdir dist && npm run pbjs && npm run pbts && cp src/* dist", | ||
"pbjs": "apollo-pbjs --target static-module --out dist/protobuf.js --wrap commonjs --force-number --no-from-object src/reports.proto", | ||
"pbts": "apollo-pbts -o dist/protobuf.d.ts dist/protobuf.js", | ||
"prepare:proto": "npm run prepare:proto:nix -s || npm run prepare:proto:win -s", | ||
"prepare:proto:nix": "grep -v \"package mdg.engine.proto\" src/reports.proto > dist/reports.proto", | ||
"prepare:proto:win": "type src\\reports.proto | findstr /V \"package mdg.engine.proto\" > dist/reports.proto" | ||
"update-proto": "curl -sSfo src/reports.proto https://usage-reporting.api.apollographql.com/proto/reports.proto" | ||
}, | ||
@@ -35,5 +33,5 @@ "repository": { | ||
"dependencies": { | ||
"@apollo/protobufjs": "^1.0.3" | ||
"@apollo/protobufjs": "1.1.0" | ||
}, | ||
"gitHead": "7e543ed5540ce5995b30b1bb2a7b54367fd49d6f" | ||
"gitHead": "6972e2379e91b08ccc458a230c6a687099dbf108" | ||
} |
@@ -6,2 +6,3 @@ const protobuf = require('./protobuf'); | ||
// than 104 days). | ||
// XXX Just remove this in our fork? | ||
// https://github.com/protobufjs/protobuf.js/issues/1253 | ||
@@ -11,23 +12,2 @@ protobufJS.util.Long = undefined; | ||
// Override the generated protobuf Traces.encode function so that it will look | ||
// for Traces that are already encoded to Buffer as well as unencoded | ||
// Traces. This amortizes the protobuf encoding time over each generated Trace | ||
// instead of bunching it all up at once at sendReport time. In load tests, this | ||
// change improved p99 end-to-end HTTP response times by a factor of 11 without | ||
// a casually noticeable effect on p50 times. This also makes it easier for us | ||
// to implement maxUncompressedReportSize as we know the encoded size of traces | ||
// as we go. | ||
const originalTracesAndStatsEncode = protobuf.TracesAndStats.encode; | ||
protobuf.TracesAndStats.encode = function(message, originalWriter) { | ||
const writer = originalTracesAndStatsEncode(message, originalWriter); | ||
const encodedTraces = message.encodedTraces; | ||
if (encodedTraces != null && encodedTraces.length) { | ||
for (let i = 0; i < encodedTraces.length; ++i) { | ||
writer.uint32(/* id 1, wireType 2 =*/ 10); | ||
writer.bytes(encodedTraces[i]); | ||
} | ||
} | ||
return writer; | ||
}; | ||
module.exports = protobuf; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
461463
9251
+ Added@apollo/protobufjs@1.1.0(transitive)
+ Added@types/node@10.17.60(transitive)
- Removed@apollo/protobufjs@1.2.7(transitive)
Updated@apollo/protobufjs@1.1.0