未验证 提交 e529448f 编写于 作者: P Peter Pan 提交者: GitHub

Millisecond (#783)

* fix: incorrect locale redirect

* chore: use millisecond
上级 0cc548ae
......@@ -220,7 +220,7 @@ const SampleChart: FunctionComponent<SampleChartProps> = ({run, tag, running, ty
<span>{run.label}</span>
</Title>
<StepSlider value={step} steps={steps} onChange={setStep} onChangeComplete={cacheSrc}>
{formatTime(wallTime * 1000, i18n.language)}
{formatTime(wallTime, i18n.language)}
</StepSlider>
<Container ref={container}>{Content}</Container>
<Footer>
......
......@@ -83,8 +83,8 @@ const PRCurve: NextI18NextPage = () => {
...run,
index: indexes[run.label] ?? (stepInfo?.[i].length ?? 1) - 1,
steps: stepInfo?.[i].map(j => j[1]) ?? [],
wallTimes: stepInfo?.[i].map(j => Math.floor(j[0] * 1000)) ?? [],
relatives: stepInfo?.[i].map(j => (j[0] - stepInfo[i][0][0]) * 1000) ?? []
wallTimes: stepInfo?.[i].map(j => Math.floor(j[0])) ?? [],
relatives: stepInfo?.[i].map(j => j[0] - stepInfo[i][0][0]) ?? []
})),
[runsInTags, stepInfo, indexes]
);
......
......@@ -17,8 +17,7 @@ export const transform = ({datasets, smoothing}: {datasets: ScalarDataset[]; smo
const bigSmoothing = new BigNumber(smoothing);
data.forEach((d, i) => {
const nextVal = new BigNumber(d[2]);
// second to millisecond.
const millisecond = (d[0] = Math.floor(d[0] * 1000));
const millisecond = (d[0] = Math.floor(d[0]));
if (i === 0) {
startValue = millisecond;
}
......
export default [
{
wallTime: 1512549785.061623,
wallTime: 1512549785061.623,
step: 60
},
{
wallTime: 1512886109.672786,
wallTime: 1512886109672.786,
step: 60
},
{
wallTime: 1512886124.266915,
wallTime: 1512886124266.915,
step: 210
},
{
wallTime: 1512886138.898628,
wallTime: 1512886138898.628,
step: 330
},
{
wallTime: 1512886139.883663,
wallTime: 1512886139883.663,
step: 340
},
{
wallTime: 1512886147.195567,
wallTime: 1512886147195.567,
step: 410
},
{
wallTime: 1512886156.47856,
wallTime: 1512886156478.56,
step: 500
},
{
wallTime: 1512886187.82793,
wallTime: 1512886187827.93,
step: 810
},
{
wallTime: 1512886200.386198,
wallTime: 1512886200386.198,
step: 950
},
{
wallTime: 1512886204.224405,
wallTime: 1512886204224.405,
step: 990
}
];
export default [
[
1515224840.945252,
1515224840945.252,
0,
[
[-4.826786994934082, -5.099814079160488, 0.0],
......@@ -62,7 +62,7 @@ export default [
]
],
[
1515224846.83122,
1515224846831.22,
70,
[
[-5.609264373779297, -5.609795487076537, 0.0],
......@@ -108,7 +108,7 @@ export default [
]
],
[
1515224850.414384,
1515224850414.384,
100,
[
[-5.622415065765381, -6.1707750357841915, 0.0],
......@@ -166,7 +166,7 @@ export default [
]
],
[
1515224852.17382,
1515224852173.82,
120,
[
[-5.641714572906494, -6.1707750357841915, 0.0],
......
export default [
{
wallTime: 1512549785.061623,
wallTime: 1512549785061.623,
step: 60
},
{
wallTime: 1512886109.672786,
wallTime: 1512886109672.786,
step: 60
},
{
wallTime: 1512886124.266915,
wallTime: 1512886124266.915,
step: 210
},
{
wallTime: 1512886138.898628,
wallTime: 1512886138898.628,
step: 330
},
{
wallTime: 1512886139.883663,
wallTime: 1512886139883.663,
step: 340
},
{
wallTime: 1512886147.195567,
wallTime: 1512886147195.567,
step: 410
},
{
wallTime: 1512886156.47856,
wallTime: 1512886156478.56,
step: 500
},
{
wallTime: 1512886187.82793,
wallTime: 1512886187827.93,
step: 810
},
{
wallTime: 1512886200.386198,
wallTime: 1512886200386.198,
step: 950
},
{
wallTime: 1512886204.224405,
wallTime: 1512886204224.405,
step: 990
}
];
......@@ -4,7 +4,7 @@ export default (request: Request) => {
if (request.query.run === 'train') {
return [
[
1593069993.786464,
1593069993786.464,
0,
[
0.3333333432674408,
......@@ -309,7 +309,7 @@ export default (request: Request) => {
]
],
[
1593069993.787353,
1593069993787.353,
1,
[
0.3333333432674408,
......@@ -628,7 +628,7 @@ export default (request: Request) => {
]
],
[
1593069993.7881448,
1593069993788.1448,
2,
[
0.3333333432674408,
......@@ -933,7 +933,7 @@ export default (request: Request) => {
]
],
[
1593069993.788836,
1593069993788.836,
3,
[
0.3333333432674408,
......@@ -1266,7 +1266,7 @@ export default (request: Request) => {
]
],
[
1593069993.7894,
1593069993789.4,
4,
[
0.3333333432674408,
......@@ -1557,7 +1557,7 @@ export default (request: Request) => {
]
],
[
1593069993.790076,
1593069993790.076,
5,
[
0.3333333432674408,
......@@ -1862,7 +1862,7 @@ export default (request: Request) => {
]
],
[
1593069993.790763,
1593069993790.763,
6,
[
0.3333333432674408,
......@@ -2195,7 +2195,7 @@ export default (request: Request) => {
]
],
[
1593069993.791473,
1593069993791.473,
7,
[
0.3333333432674408,
......@@ -2521,7 +2521,7 @@ export default (request: Request) => {
]
],
[
1593069993.792149,
1593069993792.149,
8,
[
0.3333333432674408,
......@@ -2840,7 +2840,7 @@ export default (request: Request) => {
]
],
[
1593069993.792763,
1593069993792.763,
9,
[
0.3333333432674408,
......@@ -3148,7 +3148,7 @@ export default (request: Request) => {
}
return [
[
1593069993.5386739,
1593069993538.6739,
0,
[
0.3333333432674408,
......@@ -3488,7 +3488,7 @@ export default (request: Request) => {
]
],
[
1593069993.539396,
1593069993539.396,
1,
[
0.3333333432674408,
......@@ -3807,7 +3807,7 @@ export default (request: Request) => {
]
],
[
1593069993.540066,
1593069993540.066,
2,
[
0.3333333432674408,
......@@ -4112,7 +4112,7 @@ export default (request: Request) => {
]
],
[
1593069993.540662,
1593069993540.662,
3,
[
0.3333333432674408,
......@@ -4452,7 +4452,7 @@ export default (request: Request) => {
]
],
[
1593069993.541333,
1593069993541.333,
4,
[
0.3333333432674408,
......@@ -4771,7 +4771,7 @@ export default (request: Request) => {
]
],
[
1593069993.542078,
1593069993542.078,
5,
[
0.3333333432674408,
......@@ -5097,7 +5097,7 @@ export default (request: Request) => {
]
],
[
1593069993.5431821,
1593069993543.1821,
6,
[
0.3333333432674408,
......@@ -5430,7 +5430,7 @@ export default (request: Request) => {
]
],
[
1593069993.543998,
1593069993543.998,
7,
[
0.3333333432674408,
......@@ -5756,7 +5756,7 @@ export default (request: Request) => {
]
],
[
1593069993.5449128,
1593069993544.9128,
8,
[
0.3333333432674408,
......@@ -6075,7 +6075,7 @@ export default (request: Request) => {
]
],
[
1593069993.54562,
1593069993545.62,
9,
[
0.3333333432674408,
......
......@@ -3,28 +3,28 @@ import {Request} from 'express';
export default (request: Request) => {
if (request.query.run === 'train') {
return [
[1593069993.786464, 0],
[1593069993.787353, 1],
[1593069993.7881448, 2],
[1593069993.788836, 3],
[1593069993.7894, 4],
[1593069993.790076, 5],
[1593069993.790763, 6],
[1593069993.791473, 7],
[1593069993.792149, 8],
[1593069993.792763, 9]
[1593069993786.464, 0],
[1593069993787.353, 1],
[1593069993788.1448, 2],
[1593069993788.836, 3],
[1593069993789.4, 4],
[1593069993790.076, 5],
[1593069993790.763, 6],
[1593069993791.473, 7],
[1593069993792.149, 8],
[1593069993792.763, 9]
];
}
return [
[1593069993.5386739, 0],
[1593069993.539396, 1],
[1593069993.540066, 2],
[1593069993.540662, 3],
[1593069993.541333, 4],
[1593069993.542078, 5],
[1593069993.5431821, 6],
[1593069993.543998, 7],
[1593069993.5449128, 8],
[1593069993.54562, 9]
[1593069993538.6739, 0],
[1593069993539.396, 1],
[1593069993540.066, 2],
[1593069993540.662, 3],
[1593069993541.333, 4],
[1593069993542.078, 5],
[1593069993543.1821, 6],
[1593069993543.998, 7],
[1593069993544.9128, 8],
[1593069993545.62, 9]
];
};
......@@ -47,7 +47,7 @@ pub fn transform(datasets: &Vec<Vec<Dataset>>, smoothing: f64) -> Vec<Vec<Smooth
let mut r: Smoothed = Smoothed(0, d.1, d.2, 0.0, 0.0);
let next_val: f64 = d.2;
// second to millisecond.
let millisecond: i64 = ((d.0 as f64) * 1000_f64).floor() as i64;
let millisecond: i64 = d.0.floor() as i64;
r.0 = millisecond;
if i == 0 {
start_value = millisecond;
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册