@opencensus/exporter-zpages
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -115,3 +115,3 @@ "use strict"; | ||
static secondsToNanos(seconds) { | ||
return seconds * 1e+9; | ||
return seconds * 1e9; | ||
} | ||
@@ -141,5 +141,5 @@ } | ||
LatencyBucketBoundaries.SECONDx10_SECONDx100, | ||
LatencyBucketBoundaries.SECONDx100_MAX | ||
LatencyBucketBoundaries.SECONDx100_MAX, | ||
]; | ||
exports.LatencyBucketBoundaries = LatencyBucketBoundaries; | ||
//# sourceMappingURL=latency-bucket-boundaries.js.map |
@@ -48,3 +48,5 @@ "use strict"; | ||
/** CSS styles file */ | ||
const stylesFile = ejs.fileLoader(`${templates_dir_1.templatesDir}/styles.min.css`).toString(); | ||
const stylesFile = ejs | ||
.fileLoader(`${templates_dir_1.templatesDir}/styles.min.css`) | ||
.toString(); | ||
/** EJS render options */ | ||
@@ -79,5 +81,5 @@ const options = { delimiter: '?' }; | ||
if (clientMethodIndex !== -1) { | ||
method = snapshot.tagValues[clientMethodIndex] ? | ||
snapshot.tagValues[clientMethodIndex].value : | ||
''; | ||
method = snapshot.tagValues[clientMethodIndex] | ||
? snapshot.tagValues[clientMethodIndex].value | ||
: ''; | ||
zMeasures = rpczData.measuresSent; | ||
@@ -87,5 +89,5 @@ } | ||
// Switches to received data if it's a server | ||
method = snapshot.tagValues[serverMethodIndex] ? | ||
snapshot.tagValues[serverMethodIndex].value : | ||
''; | ||
method = snapshot.tagValues[serverMethodIndex] | ||
? snapshot.tagValues[serverMethodIndex].value | ||
: ''; | ||
zMeasures = rpczData.measuresReceived; | ||
@@ -103,4 +105,3 @@ } | ||
zMeasures[method].output.min = | ||
this.getRate(zMeasures[method].output.tot, new Date(view.startTime)) * | ||
60; | ||
this.getRate(zMeasures[method].output.tot, new Date(view.startTime)) * 60; | ||
zMeasures[method].output.hr = zMeasures[method].output.min * 60; | ||
@@ -113,4 +114,3 @@ } | ||
zMeasures[method].input.min = | ||
this.getRate(zMeasures[method].input.tot, new Date(view.startTime)) * | ||
60; | ||
this.getRate(zMeasures[method].input.tot, new Date(view.startTime)) * 60; | ||
zMeasures[method].input.hr = zMeasures[method].input.min * 60; | ||
@@ -125,4 +125,3 @@ } | ||
zMeasures[method].count.min = | ||
this.getRate(zMeasures[method].count.tot, new Date(view.startTime)) * | ||
60; | ||
this.getRate(zMeasures[method].count.tot, new Date(view.startTime)) * 60; | ||
zMeasures[method].count.hr = zMeasures[method].count.min * 60; | ||
@@ -143,4 +142,3 @@ // Fills the rate columns for that method | ||
zMeasures[method].errors.min = | ||
this.getRate(zMeasures[method].errors.tot, new Date(view.startTime)) * | ||
60; | ||
this.getRate(zMeasures[method].errors.tot, new Date(view.startTime)) * 60; | ||
zMeasures[method].errors.hr = zMeasures[method].errors.min * 60; | ||
@@ -155,4 +153,3 @@ } | ||
zMeasures[method].avgLatency.min = | ||
this.getRate(zMeasures[method].avgLatency.tot, new Date(view.startTime)) * | ||
60; | ||
this.getRate(zMeasures[method].avgLatency.tot, new Date(view.startTime)) * 60; | ||
zMeasures[method].avgLatency.hr = | ||
@@ -172,3 +169,3 @@ zMeasures[method].avgLatency.min * 60; | ||
zMeasuresReceived: rpczData.measuresReceived, | ||
FIXED_SIZE | ||
FIXED_SIZE, | ||
}, options); | ||
@@ -194,3 +191,3 @@ } | ||
output: { min: 0, hr: 0, tot: 0 }, | ||
errors: { min: 0, hr: 0, tot: 0 } | ||
errors: { min: 0, hr: 0, tot: 0 }, | ||
}; | ||
@@ -197,0 +194,0 @@ } |
@@ -21,7 +21,7 @@ /** | ||
} | ||
export declare type ZPagesStatsData = { | ||
export interface ZPagesStatsData { | ||
tagKeys: TagKey[]; | ||
tagValues?: Array<TagValue | null>; | ||
snapshot?: AggregationData; | ||
}; | ||
} | ||
/** | ||
@@ -28,0 +28,0 @@ * Information used to render the Statsz UI. |
@@ -97,3 +97,3 @@ "use strict"; | ||
viewsCount: 1, | ||
isLastFolder | ||
isLastFolder, | ||
}; | ||
@@ -142,3 +142,3 @@ } | ||
table_content: tableContent, | ||
path | ||
path, | ||
}, options); | ||
@@ -160,3 +160,3 @@ } | ||
tagValues: snapshot.tagValues, | ||
snapshot | ||
snapshot, | ||
}; | ||
@@ -163,0 +163,0 @@ }); |
@@ -20,3 +20,3 @@ "use strict"; | ||
/** The directory to search for templates. */ | ||
exports.templatesDir = function getTemplatesDir() { | ||
exports.templatesDir = (function getTemplatesDir() { | ||
// When this file is compiled to JS, it will live in the 'build' dir which | ||
@@ -29,3 +29,3 @@ // is a peer of 'templates'. Tests don't compile, so the relative path is | ||
return path.join(__dirname, '../../../templates'); | ||
}(); | ||
})(); | ||
//# sourceMappingURL=templates-dir.js.map |
@@ -35,7 +35,9 @@ "use strict"; | ||
this.defaultConfig = { | ||
samplingRate: TraceConfigzPageHandler.extractSamplingProbability() | ||
samplingRate: TraceConfigzPageHandler.extractSamplingProbability(), | ||
}; | ||
} | ||
/** template HTML */ | ||
const traceConfigzFile = ejs.fileLoader(`${templates_dir_1.templatesDir}/traceconfigz.ejs`).toString(); | ||
const traceConfigzFile = ejs | ||
.fileLoader(`${templates_dir_1.templatesDir}/traceconfigz.ejs`) | ||
.toString(); | ||
/** EJS render options */ | ||
@@ -48,3 +50,3 @@ const options = { delimiter: '?' }; | ||
defaultConfig: this.defaultConfig, | ||
samplingProbability | ||
samplingProbability, | ||
}; | ||
@@ -65,4 +67,3 @@ if (json) { | ||
if (query.change === 'restore_default') { | ||
tracing.tracer.sampler = | ||
core_1.SamplerBuilder.getSampler(this.defaultConfig.samplingRate); | ||
tracing.tracer.sampler = core_1.SamplerBuilder.getSampler(this.defaultConfig.samplingRate); | ||
return; | ||
@@ -72,4 +73,3 @@ } | ||
if (query.samplingprobability) { | ||
tracing.tracer.sampler = | ||
core_1.SamplerBuilder.getSampler(query.samplingprobability); | ||
tracing.tracer.sampler = core_1.SamplerBuilder.getSampler(query.samplingprobability); | ||
} | ||
@@ -76,0 +76,0 @@ } |
@@ -17,10 +17,10 @@ /** | ||
import { Span } from '@opencensus/core'; | ||
export declare type TracezParams = { | ||
export interface TracezParams { | ||
tracename: string; | ||
type: string; | ||
}; | ||
} | ||
/** Index to latencies */ | ||
export declare type Latency = { | ||
export interface Latency { | ||
[key: string]: number; | ||
}; | ||
} | ||
/** | ||
@@ -27,0 +27,0 @@ * Information needed to display selected traces. |
@@ -62,3 +62,3 @@ "use strict"; | ||
parentSpanId: inputSpan.parentSpanId, | ||
spans: [] | ||
spans: [], | ||
}; | ||
@@ -69,3 +69,3 @@ span.spans = inputSpan.spans.map((childSpan) => ({ | ||
name: childSpan.name, | ||
duration: childSpan.duration | ||
duration: childSpan.duration, | ||
})); | ||
@@ -93,5 +93,5 @@ return span; | ||
SECONDx10_SECONDx100: 0, | ||
SECONDx100_MAX: 0 | ||
SECONDx100_MAX: 0, | ||
}, | ||
ERRORS: 0 | ||
ERRORS: 0, | ||
}; | ||
@@ -122,5 +122,11 @@ // Building span list | ||
const tracezFile = ejs.fileLoader(`${templates_dir_1.templatesDir}/tracez.ejs`).toString(); | ||
const stylesFile = ejs.fileLoader(`${templates_dir_1.templatesDir}/styles.min.css`).toString(); | ||
const summaryFile = ejs.fileLoader(`${templates_dir_1.templatesDir}/summary.ejs`).toString(); | ||
const spanCellFile = ejs.fileLoader(`${templates_dir_1.templatesDir}/span-cell.ejs`).toString(); | ||
const stylesFile = ejs | ||
.fileLoader(`${templates_dir_1.templatesDir}/styles.min.css`) | ||
.toString(); | ||
const summaryFile = ejs | ||
.fileLoader(`${templates_dir_1.templatesDir}/summary.ejs`) | ||
.toString(); | ||
const spanCellFile = ejs | ||
.fileLoader(`${templates_dir_1.templatesDir}/span-cell.ejs`) | ||
.toString(); | ||
const spansFile = ejs.fileLoader(`${templates_dir_1.templatesDir}/spans.ejs`).toString(); | ||
@@ -177,3 +183,3 @@ /** EJS render options */ | ||
traces: traceList.map(serializeSpan), | ||
getCanonicalCode | ||
getCanonicalCode, | ||
}; | ||
@@ -190,5 +196,8 @@ } | ||
/** HTML selected trace list */ | ||
const renderedSelectedTraces = selectedTraces ? ejs.render(spansFile, selectedTraces, options) : ''; | ||
const renderedSelectedTraces = selectedTraces | ||
? ejs.render(spansFile, selectedTraces, options) | ||
: ''; | ||
/** RootSpan lines */ | ||
const renderedSpanCells = spanCells.map(spanCell => ejs.render(spanCellFile, spanCell, options)) | ||
const renderedSpanCells = spanCells | ||
.map(spanCell => ejs.render(spanCellFile, spanCell, options)) | ||
.join(''); | ||
@@ -199,3 +208,3 @@ return ejs.render(tracezFile, { | ||
title: 'TraceZ Summary', | ||
selectedTraces: renderedSelectedTraces | ||
selectedTraces: renderedSelectedTraces, | ||
}, options); | ||
@@ -202,0 +211,0 @@ } |
@@ -28,3 +28,3 @@ "use strict"; | ||
registeredMeasures: [], | ||
recordedData: {} | ||
recordedData: {}, | ||
}; | ||
@@ -35,5 +35,5 @@ /** create express app */ | ||
this.logger = options.logger || core_1.logger.logger(); | ||
const startServer = options.startServer != null ? | ||
options.startServer : | ||
ZpagesExporter.defaultOptions.startServer; | ||
const startServer = options.startServer != null | ||
? options.startServer | ||
: ZpagesExporter.defaultOptions.startServer; | ||
/** register predefined span names, if any */ | ||
@@ -40,0 +40,0 @@ if (options.spanNames) { |
{ | ||
"name": "@opencensus/exporter-zpages", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "A collection of HTML pages to display stats and trace data and allow library configuration control", | ||
@@ -53,3 +53,3 @@ "main": "build/src/index.js", | ||
"devDependencies": { | ||
"@opencensus/nodejs": "^0.0.14", | ||
"@opencensus/nodejs": "^0.0.15", | ||
"@types/ejs": "^2.6.0", | ||
@@ -61,4 +61,4 @@ "@types/express": "^4.11.1", | ||
"axios": "^0.19.0", | ||
"codecov": "^3.4.0", | ||
"gts": "^0.9.0", | ||
"codecov": "^3.5.0", | ||
"gts": "^1.0.0", | ||
"mocha": "^6.1.0", | ||
@@ -72,3 +72,3 @@ "nyc": "14.1.1", | ||
"dependencies": { | ||
"@opencensus/core": "^0.0.14", | ||
"@opencensus/core": "^0.0.15", | ||
"ejs": "^2.5.8", | ||
@@ -75,0 +75,0 @@ "express": "^4.16.3" |
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
1747
115808
+ Added@opencensus/core@0.0.15(transitive)
- Removed@opencensus/core@0.0.14(transitive)
Updated@opencensus/core@^0.0.15