Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
emitHtml(json: boolean): string {
/** template HTML */
const rpczFile = ejs.fileLoader(`${templatesDir}/rpcz.ejs`).toString();
/** CSS styles file */
const stylesFile = ejs
.fileLoader(`${templatesDir}/styles.min.css`)
.toString();
/** EJS render options */
const options = { delimiter: '?' };
const rpcViews = this.statsParams.registeredViews.filter(
view => view.name.indexOf('http') < 0
);
const rpczData: RpczData = { measuresSent: {}, measuresReceived: {} };
for (const view of rpcViews) {
const recordedData = this.statsParams.recordedData[view.name];
let clientMethodIndex = -1;
private loaderFile(fileName: string): string {
const fileDir = path.join(templatesDir, fileName);
return ejs.fileLoader(fileDir, 'utf8');
}
}
emitHtml(params: Partial, json: boolean): string {
if (params) {
this.saveChanges(params);
}
if (!this.defaultConfig) {
this.defaultConfig = {
samplingRate: TraceConfigzPageHandler.extractSamplingProbability(),
};
}
/** template HTML */
const traceConfigzFile = ejs
.fileLoader(`${templatesDir}/traceconfigz.ejs`)
.toString();
/** EJS render options */
const options = { delimiter: '?' };
/** Current sampling rate */
const samplingProbability = TraceConfigzPageHandler.extractSamplingProbability();
/** Rendering the HTML table summary */
const renderParams: TraceConfigzData = {
defaultConfig: this.defaultConfig,
samplingProbability,
};
if (json) {
return JSON.stringify(renderParams, null, 2);
} else {
return ejs.render(traceConfigzFile, renderParams, options);
emitHtml(params: Partial, json: boolean): string {
const tracezFile = ejs.fileLoader(`${templatesDir}/tracez.ejs`).toString();
const stylesFile = ejs
.fileLoader(`${templatesDir}/styles.min.css`)
.toString();
const summaryFile = ejs
.fileLoader(`${templatesDir}/summary.ejs`)
.toString();
const spanCellFile = ejs
.fileLoader(`${templatesDir}/span-cell.ejs`)
.toString();
const spansFile = ejs.fileLoader(`${templatesDir}/spans.ejs`).toString();
/** EJS render options */
const options = { delimiter: '?' };
/** Latency array */
const latencyBucketBoundaries = LatencyBucketBoundaries.values;
/** Latency names list */
const latencyBucketNames = [];