Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
ntpsec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
NTPsec
ntpsec
Commits
59dc7e80
Commit
59dc7e80
authored
8 years ago
by
Gary E. Miller
Browse files
Options
Downloads
Patches
Plain Diff
Use a 'title' file if present in the output directory.
I run 8 copies of ntpviz, now I can tell them apart.
parent
45a4e9b8
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/includes/ntpviz-body.txt
+6
-2
6 additions, 2 deletions
docs/includes/ntpviz-body.txt
ntpstats/ntpviz
+17
-5
17 additions, 5 deletions
ntpstats/ntpviz
with
23 additions
and
7 deletions
docs/includes/ntpviz-body.txt
+
6
−
2
View file @
59dc7e80
...
...
@@ -105,8 +105,9 @@ named 'ntpgraphs', but the name can be changed with the -o option.
Warning: existing PNG files and index.html in this directory will be
clobbered.
When an index is generated, ntpviz will look for two files in the
output directory. Neither file need be present, and both files may
When an index is generated, ntpviz will look for three files in the
output directory. None of the files need be present, and the
'header' and 'footer' files may contain arbitrary html.
contain aribtrary HTML.
The first file is named 'header'. The contents of that file will be
...
...
@@ -120,6 +121,9 @@ added almost at the bottom of the body on the generated index.
It is suggested that notes on the server be included in the footer
file: OS, versions, CPU speed, etc. You may also put links there.
The thrid file is named 'title' and must be a single line of text. This
text will be used as the HTML title of the generated index.
The code includes various sanity checks and will bail out with a message to
standard error on, for example, missing logfile data required for a plot.
...
...
This diff is collapsed.
Click to expand it.
ntpstats/ntpviz
+
17
−
5
View file @
59dc7e80
...
...
@@ -820,6 +820,19 @@ at 0s. Typical 90% ranges may be: local serial GPS 200 ms; local LAN peer
""",
}
start_time = datetime.datetime.utcnow()
start_time_str = start_time.strftime("%c")
# if title file, get title from it
title_f = os.path.join(outdir, "title")
title = 'ntpviz'
if os.path.isfile(title_f):
try:
title_file = open( title_f, 'r')
title = title_file.read()
except IOError:
pass
index_header = '''\
<!DOCTYPE html>
<html
lang=
"en"
>
...
...
@@ -827,7 +840,7 @@ at 0s. Typical 90% ranges may be: local serial GPS 200 ms; local LAN peer
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"refresh"
content=
"1800"
>
<meta
name=
"expires"
content=
"0"
>
<title>
ntpviz plot
</title>
<title>
%(title)s
</title>
<style>
dt
{
font-weight
:
bold
;
...
...
@@ -845,11 +858,10 @@ dd {
<img
src=
"ntpsec-logo.png"
alt=
"NTPsec"
style=
"float:left;margin:5px 50px;"
>
</a>
<div>
<h1
style=
"margin-bottom:10px;"
>
NTP Stats
</h1>
'''
<h1
style=
"margin-bottom:10px;"
>
%(title)s
</h1>
Report generated: %(start_time_str)s UTC
<br>
''' % locals()
start_time = datetime.datetime.utcnow()
index_header += 'Report generated: %s UTC
<br>
' % start_time.strftime("%c")
# Ugh. Not clear what to do in the multiplot case
if len(statlist) == 1:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment