Platform
Solutions
Resources
Pricing
Sign in
Sign up
Bill Mill
Workspace
Fork
Public
By
Bill Mill
Edited
Nov 9, 2023
ISC
Fork of
Plot Scatterplot
8
Insert cell
Insert cell
poll
=
FileAttachment
(
"poll.log"
)
.
csv
(
{
typed
:
true
}
)
Insert cell
Plot
.
plot
(
{
inset
:
8
,
grid
:
true
,
color
:
{
legend
:
true
}
,
marks
:
[
Plot
.
line
(
poll
,
{
x
:
"Date"
,
y
:
(
d
)
=>
d
[
"FirstByteMs"
]
+
d
[
"TransferMs"
]
}
)
]
}
)
Insert cell
primaryswitch
=
FileAttachment
(
"poll.log.primaryswitch.csv"
)
.
csv
(
{
typed
:
true
}
)
Insert cell
Plot
.
plot
(
{
inset
:
8
,
grid
:
true
,
color
:
{
legend
:
true
}
,
marks
:
[
Plot
.
line
(
primaryswitch
,
{
x
:
"Date"
,
y
:
(
d
)
=>
d
[
"FirstByteMs"
]
+
d
[
"TransferMs"
]
}
)
]
}
)
Insert cell
killva
=
FileAttachment
(
"poll.log.3"
)
.
csv
(
{
typed
:
true
}
)
Insert cell
Plot
.
plot
(
{
inset
:
8
,
grid
:
true
,
color
:
{
legend
:
true
}
,
marks
:
[
Plot
.
line
(
killva
,
{
x
:
"Date"
,
y
:
(
d
)
=>
d
[
"FirstByteMs"
]
+
d
[
"TransferMs"
]
}
)
]
}
)
Insert cell
staging1
=
FileAttachment
(
"transition_contd_2.csv"
)
.
csv
(
{
typed
:
true
}
)
Insert cell
Plot
.
plot
(
{
inset
:
8
,
grid
:
true
,
color
:
{
legend
:
true
}
,
marks
:
[
Plot
.
line
(
staging1
,
{
x
:
"Date"
,
y
:
(
d
)
=>
d
[
"FirstByteMs"
]
+
d
[
"TransferMs"
]
}
)
]
}
)
Insert cell
switchleader
=
FileAttachment
(
"switchleader.csv"
)
.
csv
(
{
typed
:
true
}
)
Insert cell
Plot
.
plot
(
{
inset
:
8
,
grid
:
true
,
color
:
{
legend
:
true
}
,
marks
:
[
Plot
.
line
(
switchleader
,
{
x
:
"Date"
,
y
:
(
d
)
=>
d
[
"FirstByteMs"
]
+
d
[
"TransferMs"
]
}
)
]
}
)
Insert cell
dropca
=
FileAttachment
(
"dropca.csv"
)
.
csv
(
{
typed
:
true
}
)
Insert cell
Plot
.
plot
(
{
inset
:
8
,
grid
:
true
,
color
:
{
legend
:
true
}
,
marks
:
[
Plot
.
line
(
dropca
,
{
x
:
"Date"
,
y
:
(
d
)
=>
d
[
"FirstByteMs"
]
+
d
[
"TransferMs"
]
}
)
]
}
)
Insert cell
// the script used to generate the data follows:
{
// Output columns:
// - date/time that request was fired
// - HTTP status code
// - time to first byte (milliseconds)
// - time from first byte to last byte
//
// URL points to the ReadMe docs' "Best Practices" page
// readmebackup.com uses MongoDB Atlas database readme-support
const
URL
=
'<censored>/main/docs/best-practices'
;
const
AUTH_VALUE
=
'<censored>'
;
async
function
pollOnce
(
)
{
const
currentTs
=
Date
.
now
(
)
;
const
currentMs
=
currentTs
-
Math
.
floor
(
currentTs
/
1000
)
*
1000
;
const
sleepMs
=
1000
-
currentMs
;
setTimeout
(
pollOnce
,
sleepMs
)
;
const
t0
=
Date
.
now
(
)
;
const
d
=
new
Date
(
)
;
const
resp
=
await
fetch
(
URL
,
{
headers
:
{
Authorization
:
AUTH_VALUE
}
,
redirect
:
'manual'
}
)
;
const
t1
=
Date
.
now
(
)
;
await
resp
.
text
(
)
;
const
t2
=
Date
.
now
(
)
;
const
output
=
[
d
.
toISOString
(
)
,
resp
.
status
,
t1
-
t0
,
t2
-
t1
]
;
console
.
log
(
output
.
join
(
','
)
)
;
}
console
.
log
(
'Date,Status,FirstByteMs,TransferMs'
)
;
pollOnce
(
)
;
}
Insert cell
One platform
to build and deploy the best data apps
Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
poll
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
primaryswitch
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
killva
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
staging1
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
switchleader
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dropca
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML