Comments (3)
So I started working on this again. The specific problem is that we throw away the timezone when we parse the date/time from the YAML report.
I first of all looked at different parsing-libraries, such as this one:
Then I realized that we can simplify this problem enormously:
- If we receive a HTTP-upload we know that puppet "just ran".
- So don't bother parsing the
time:
field. - Instead we regard the time that puppet ran as the insert-time.
So our insertion code changes from:
stmt, err := tx.Prepare("INSERT INTO reports(fqdn,state,yaml_file,executed_at,runtime, failed, changed, total, skipped) values(?,?,?,?,?,?,?,?,?)")
To this:
stmt, err := tx.Prepare("INSERT INTO reports(fqdn,state,yaml_file,executed_at,runtime, failed, changed, total, skipped) values(?,?,?,'NOW()',?,?,?,?,?)")
That will let us calculate relative times in the DB-layer, I think?
from puppet-summary.
To recap. There are two possible solutions here:
- Get better at parsing the submission-time, from the YAML upload.
- Avoid the problem entirely and record the time the report was received.
- This is close to the time that puppet ran, but obviously not 100% identical.
- Since the time the report is received is local to the puppet-usummary server we can calculate the difference to
now
when we handle serving the HTML/JSON/XML reports and it'll all "just work".
I'm leaning toward to the second solution due to simplicity but it will require a DB-change, which means that either we need to explain to users how to make that change, or we must insist the local database is wiped and recreated, orphaning any existing reports.
Due to this breaking-change I don't want to do anything hasty, on that basis I'm going to make the next release before coming back to this issue.
from puppet-summary.
Plan:
- Stop populating / using the
AtUnix
field. - Reports will be written to $prefix/$hostname/$hash
- Where $hash is the hash of the report-contents.
- This will still allow us to identify duplicate-submissions.
- Add a new field to the database, as a migration, which will be the submission time.
- If this is present use it. (i.e. New submissions.)
- If not fall back to the the
At
field.
from puppet-summary.
Related Issues (20)
- go-bindata is depreciated HOT 1
- Pruning does not appear to be working HOT 7
- Metrics submission seems to be somewhat broken right now. HOT 1
- Feature request, sorting HOT 2
- Feature Request, tab for environments HOT 1
- Pruning/auto-pruning not working due to locked database HOT 2
- Issue: Node count doesn't increase when new nodes come online. HOT 8
- Performance issues in initial display HOT 1
- Add static-check analysis to the test-script,. HOT 1
- Add screenshots, remove sample link.
- Do not depend on external sites HOT 3
- Feature Request: Certificate request manual approvals
- stale environments in drop down for environments HOT 18
- max limit on node report display is 50? HOT 3
- static font files are 404 HOT 1
- add a donation link to readme HOT 2
- search results are not sortable HOT 3
- Add option to delete database record if status is unchanged and yaml_file is pruned HOT 1
- puppet-summary fails on CentOS 7 due to too old glibc HOT 1
- debian 11 - go install - nothing happens HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-summary.