-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration testing for latency instrumentation
Adds a thorough integration test which tests latency instrumentation by querying a resource which makes a downstream call to itself, recording timing info along the way. This timing info is checked for completeness and consistency. RB=1745931 G=sf-reviewers R=fcapponi,ssheng,crzhang,bsoetarm,dmessink A=kbalasub,crzhang,bsoetarm
- Loading branch information
Showing
15 changed files
with
933 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
.../com.linkedin.restli.examples.instrumentation.client.latencyInstrumentation.restspec.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name" : "latencyInstrumentation", | ||
"namespace" : "com.linkedin.restli.examples.instrumentation.client", | ||
"path" : "/latencyInstrumentation", | ||
"schema" : "com.linkedin.restli.examples.instrumentation.api.InstrumentationControl", | ||
"doc" : "Resource used for testing framework latency instrumentation.\n\n The integration test using this resource queries {@link #create(InstrumentationControl)} (the \"upstream endpoint\"),\n which queries {@link #batchPartialUpdate(BatchPatchRequest)} (the \"downstream endpoint\"). The \"upstream endpoint\"\n collects all the client-side timing data after the downstream call has completed and packs it into the original\n server-side request context so that the integration test has access to all of it.\n\n The input entity itself indicates to the resource whether to use streaming or rest, whether to throw an exception at\n both endpoints, whether to use scatter-gather for the downstream request, and what its own hostname is so it can make\n the circular downstream request. The \"upstream endpoint\" sets a special header so that the integration test knows\n which request to analyze, this is done to avoid analyzing the protocol version fetch request.\n\ngenerated from: com.linkedin.restli.examples.instrumentation.server.LatencyInstrumentationResource", | ||
"collection" : { | ||
"identifier" : { | ||
"name" : "latencyInstrumentationId", | ||
"type" : "long" | ||
}, | ||
"supports" : [ "batch_partial_update", "create" ], | ||
"methods" : [ { | ||
"annotations" : { | ||
"returnEntity" : { } | ||
}, | ||
"method" : "create", | ||
"doc" : "This is the \"upstream endpoint\" which is queried directly by the integration test.\n This endpoint makes a call to {@link #batchPartialUpdate(BatchPatchRequest)} (the \"downstream endpoint\"),\n then packs all the client-side timing data into the original server-side request context." | ||
}, { | ||
"annotations" : { | ||
"returnEntity" : { } | ||
}, | ||
"method" : "batch_partial_update", | ||
"doc" : "This is the \"downstream endpoint\", queried by {@link #create(InstrumentationControl)} (the \"upstream endpoint\")." | ||
} ], | ||
"entity" : { | ||
"path" : "/latencyInstrumentation/{latencyInstrumentationId}" | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...main/pegasus/com/linkedin/restli/examples/instrumentation/api/InstrumentationControl.pdsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"type" : "record", | ||
"name" : "InstrumentationControl", | ||
"namespace" : "com.linkedin.restli.examples.instrumentation.api", | ||
"doc" : "A record containing control information for latency instrumentation testing.", | ||
"fields" : [ | ||
{ | ||
"name" : "serviceUriPrefix", | ||
"type" : "string", | ||
"doc" : "URI prefix of the service running the instrumentation resource." | ||
}, | ||
{ | ||
"name" : "useStreaming", | ||
"type" : "boolean", | ||
"doc" : "Whether the resource should use streaming for its downstream service calls." | ||
}, | ||
{ | ||
"name" : "forceException", | ||
"type" : "boolean", | ||
"doc" : "Whether the resource should throw service exceptions." | ||
}, | ||
{ | ||
"name" : "useScatterGather", | ||
"type" : "boolean", | ||
"doc" : "Whether the resource should use scatter-gather for its downstream service calls." | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
.../com.linkedin.restli.examples.instrumentation.client.latencyInstrumentation.snapshot.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"models" : [ { | ||
"type" : "record", | ||
"name" : "InstrumentationControl", | ||
"namespace" : "com.linkedin.restli.examples.instrumentation.api", | ||
"doc" : "A record containing control information for latency instrumentation testing.", | ||
"fields" : [ { | ||
"name" : "serviceUriPrefix", | ||
"type" : "string", | ||
"doc" : "URI prefix of the service running the instrumentation resource." | ||
}, { | ||
"name" : "useStreaming", | ||
"type" : "boolean", | ||
"doc" : "Whether the resource should use streaming for its downstream service calls." | ||
}, { | ||
"name" : "forceException", | ||
"type" : "boolean", | ||
"doc" : "Whether the resource should throw service exceptions." | ||
}, { | ||
"name" : "useScatterGather", | ||
"type" : "boolean", | ||
"doc" : "Whether the resource should use scatter-gather for its downstream service calls." | ||
} ] | ||
} ], | ||
"schema" : { | ||
"name" : "latencyInstrumentation", | ||
"namespace" : "com.linkedin.restli.examples.instrumentation.client", | ||
"path" : "/latencyInstrumentation", | ||
"schema" : "com.linkedin.restli.examples.instrumentation.api.InstrumentationControl", | ||
"doc" : "Resource used for testing framework latency instrumentation.\n\n The integration test using this resource queries {@link #create(InstrumentationControl)} (the \"upstream endpoint\"),\n which queries {@link #batchPartialUpdate(BatchPatchRequest)} (the \"downstream endpoint\"). The \"upstream endpoint\"\n collects all the client-side timing data after the downstream call has completed and packs it into the original\n server-side request context so that the integration test has access to all of it.\n\n The input entity itself indicates to the resource whether to use streaming or rest, whether to throw an exception at\n both endpoints, whether to use scatter-gather for the downstream request, and what its own hostname is so it can make\n the circular downstream request. The \"upstream endpoint\" sets a special header so that the integration test knows\n which request to analyze, this is done to avoid analyzing the protocol version fetch request.\n\ngenerated from: com.linkedin.restli.examples.instrumentation.server.LatencyInstrumentationResource", | ||
"collection" : { | ||
"identifier" : { | ||
"name" : "latencyInstrumentationId", | ||
"type" : "long" | ||
}, | ||
"supports" : [ "batch_partial_update", "create" ], | ||
"methods" : [ { | ||
"annotations" : { | ||
"returnEntity" : { } | ||
}, | ||
"method" : "create", | ||
"doc" : "This is the \"upstream endpoint\" which is queried directly by the integration test.\n This endpoint makes a call to {@link #batchPartialUpdate(BatchPatchRequest)} (the \"downstream endpoint\"),\n then packs all the client-side timing data into the original server-side request context." | ||
}, { | ||
"annotations" : { | ||
"returnEntity" : { } | ||
}, | ||
"method" : "batch_partial_update", | ||
"doc" : "This is the \"downstream endpoint\", queried by {@link #create(InstrumentationControl)} (the \"upstream endpoint\")." | ||
} ], | ||
"entity" : { | ||
"path" : "/latencyInstrumentation/{latencyInstrumentationId}" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.