Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pt-br] Pagina das linguagens - JS (Brazil) #5324

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions content/pt/docs/languages/js/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: JavaScript
description: >-
<img width="35" class="img-initial" src="/img/logos/32x32/JS_SDK.svg"
alt="JavaScript"> Uma implementação específica da linguagem do OpenTelemetry em JavaScript (para Node.js & the browser).
aliases: [/js, /js/metrics, /js/tracing]
cSpell:ignore: Roadmap
weight: 20
default_lang_commit: 06837fe15457a584f6a9e09579be0f0400593d57
---

{{% docs/languages/index-intro js /%}}

{{% alert title="Warning" color="warning" %}}
{{% _param notes.browser-instrumentation %}} {{% /alert %}}

## Versões Suportadas

OpenTelemetry JavaScript suporta todas as versões LTS ativas ou de manutenção Node.js. Versões anteriores de Node.js podem funcionar, mas não são testadas pelo OpenTelemetry.

OpenTelemetry JavaScript não tem uma lista oficial de navegadores suportados. O objetivo é funcionar nas versões atuais dos principais navegadores.

Para mais detalhes sobre o suporte em tempo de execução, consulte
[visão geral](https://github.com/open-telemetry/opentelemetry-js#supported-runtimes).

## Repositórios

OpenTelemetry JavaScript consiste nos seguintes repositórios:

- [opentelemetry-js](https://github.com/open-telemetry/opentelemetry-js), repositório principal contendo a API de distribuição principal e o SDK.
- [opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib), contribuições que não fazem parte da distribuição principal da API e do SDK

## Ajuda ou Feedback

Se você tiver dúvidas sobre o OpenTelemetry JavaScript, entre em contato conosco através do
[GitHub Discussions](https://github.com/open-telemetry/opentelemetry-js/discussions)
ou o [#otel-js] canal [CNCF Slack](https://slack.cncf.io/).

Se você quer contribuir com OpenTelemetry JavaScript, veja o
[contributing instructions](https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md)
9 changes: 9 additions & 0 deletions content/pt/docs/languages/js/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: API referência
linkTitle: API
description: Leia o OpenTelemetry JavaScript API referencia _(external page)_
redirect: https://open-telemetry.github.io/opentelemetry-js/
manualLinkTarget: _blank
_build: { render: link }
weight: 210
---
189 changes: 189 additions & 0 deletions content/pt/docs/languages/js/benchmarks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
---
title: Benchmarks
weight: 101
cSpell:ignore: Elems rrggbbaa
---

<link rel="stylesheet" href="/css/benchmarks.css">

The OpenTelemetry JavaScript SDK runs benchmark tests on every commit to the
[opentelemetry-js](https://github.com/open-telemetry/opentelemetry-js/)
repository. The intent of these tests is to track performance trend of critical
operations over time. These test are not a replacement for end-to-end
performance testing.

<div class="container">
<main id="main"></main>
</div>

<footer>
<button id="dl-button">Download data as JSON</button>
<div class="spacer"></div>
<div class="small">Powered by <a rel="noopener"
href="https://github.com/marketplace/actions/continuous-benchmark">github-action-benchmark</a></div>
</footer>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.min.js"></script>
<script src="https://open-telemetry.github.io/opentelemetry-js/benchmarks/data.js"></script>
<script id="main-script">
'use strict';
(function() {
const COLORS = [
"#48aaf9",
"#8a3ef2",
"#78eeda",
"#d78000",
"#1248b3",
"#97dbfc",
"#006174",
"#00b6b6",
"#854200",
"#f3c8ad",
"#410472",
];

function init() {
function collectBenchesPerTestCase(entries) {
const map = new Map();
for (const entry of entries) {
const {commit, date, tool, benches} = entry;
for (const bench of benches) {
const result = { commit, date, tool, bench };
const arr = map.get(bench.name);
if (arr === undefined) {
map.set(bench.name, [result]);
} else {
arr.push(result);
}
}
}
return map;
}

const data = window.BENCHMARK_DATA;

// Render footer
document.getElementById('dl-button').onclick = () => {
const dataUrl = 'data:,' + JSON.stringify(data, null, 2);
const a = document.createElement('a');
a.href = dataUrl;
a.download = 'benchmark_data.json';
a.click();
};

// Prepare data points for charts
return Object.keys(data.entries).map(name => ({
name,
dataSet: collectBenchesPerTestCase(data.entries[name]),
}));
}

function renderAllChars(dataSets) {

function renderGraph(parent, name, dataset) {
const chartTitle = document.createElement('h3');
chartTitle.textContent = name;
parent.append(chartTitle);

const canvas = document.createElement('canvas');
canvas.className = 'benchmark-chart';
parent.appendChild(canvas);

const color = COLORS[0];
const data = {
labels: dataset.map(d => d.commit.id.slice(0, 7)),
datasets: [
{
label: name,
data: dataset.map(d => d.bench.value),
borderColor: color,
backgroundColor: color + '60', // Add alpha for #rrggbbaa,
fill: false
}
],
};
const options = {
scales: {
xAxes: [
{
scaleLabel: {
display: true,
labelString: 'commit',
},
}
],
yAxes: [
{
scaleLabel: {
display: true,
labelString: dataset.length > 0 ? dataset[0].bench.unit : '',
},
ticks: {
beginAtZero: true,
}
}
],
},
tooltips: {
callbacks: {
afterTitle: items => {
const {index} = items[0];
const data = dataset[index];
return '\n' + data.commit.message + '\n\n' + data.commit.timestamp + ' committed by @' + data.commit.committer.username + '\n';
},
label: item => {
let label = item.value;
const { range, unit } = dataset[item.index].bench;
label += ' ' + unit;
if (range) {
label += ' (' + range + ')';
}
return label;
},
afterLabel: item => {
const { extra } = dataset[item.index].bench;
return extra ? '\n' + extra : '';
}
}
},
onClick: (_mouseEvent, activeElems) => {
if (activeElems.length === 0) {
return;
}
// XXX: Undocumented. How can we know the index?
const index = activeElems[0]._index;
const url = dataset[index].commit.url;
window.open(url, '_blank');
},
};

new Chart(canvas, {
type: 'line',
data,
options,
});
}

function renderBenchSet(name, benchSet, main) {
const setElem = document.createElement('div');
setElem.className = 'benchmark-set';
main.appendChild(setElem);

const graphsElem = document.createElement('div');
graphsElem.className = 'benchmark-graphs';
setElem.appendChild(graphsElem);

for (const [benchName, benches] of benchSet.entries()) {
renderGraph(graphsElem, benchName, benches)
}
}

const main = document.getElementById('main');
for (const {name, dataSet} of dataSets) {
renderBenchSet(name, dataSet, main);
}
}

renderAllChars(init()); // Start
})();
</script>
Loading