Comments (9)
Currently, the most importans JS code in the index.html is written in one line, getting longer and longer with every run.
As an example, in my index.html I have this code:
<script>var results = [{"requests":{"values":[>92.000 more characters here]</script>
This is barely maintainable by a human. It would be much better to break the code into single lines, like this:
<script>var results = [
{
/* 2014-01-01 08:15:00 */
"requests":{
"values":[156,156,156,156,156,null],"sum":780,"min":156,"max":156,"median":156,"average":156
},
"gzipRequests":{
"values":[37,37,37,37,37,null],"sum":185,"min":37,"max":37,"median":37,"average":37
},
[..]
/* 2014-01-02 08:15:00 */
"requests":{
"values":[156,156,156,156,156,null],"sum":780,"min":156,"max":156,"median":156,"average":156
},
"gzipRequests":{
"values":[37,37,37,37,37,null],"sum":185,"min":37,"max":37,"median":37,"average":37
},
That is, data could be split into several lines - at least one line per phantomas run, but maybe even in several lines as shown above - preceded with the corresponding human readable date and time in a separate line as JS comment, so that one can e.g. easily remove data sets from the whole code.
from grunt-phantomas.
@stryju can think of any way to get the requested date into it? It would be perfect then. ;)
/* 2014-01-02 08:15:00 */
"requests":{
"values":[156,156,156,156,156,null],"sum":780,"min":156,"max":156,"median":156,"average":156
},
from grunt-phantomas.
date as object prop?
results = {
'2014-01-01 08:15:00' : {
'requests' : ...,
...
},
'2014-01-02 08:15:00' : { ... },
...
}
this would still be traversable, order is still maintained (via timestamps)
from grunt-phantomas.
the timestamp indexing sounds like a new feature - beyond the scope of this bug
@Augenfeind agreed? if so, please create a new feature request - should be able to fix up a PR for that soon ;-)
from grunt-phantomas.
Better, but not completely done yet.
from grunt-phantomas.
@Augenfeind feel free to close, if you agree with @stryju and create another feature request. :)
from grunt-phantomas.
@stryju I agree!
@stefanjudis You created this issue - I can not close it ;)
from grunt-phantomas.
Haha. :)
from grunt-phantomas.
damn - it writes the formatted json files, but not the index.html ^^
will fix that :)
from grunt-phantomas.
Related Issues (20)
- Option to measure third parties
- custom html templates HOT 7
- Make it a standalone node module HOT 5
- Is specificity graph possible with analyze css? HOT 1
- Installing for --save-dev requires root privileges HOT 2
- Maximum Assertions? HOT 7
- Heavy load for UI with many results HOT 4
- include version number in UI
- Remove one of the licenses HOT 1
- Limit included results HOT 3
- Illegal character for windows in screenshot filenames HOT 5
- Phantomas runs are not synchronous HOT 2
- Filmstrip and Screenshopt doesn't render webfonts HOT 2
- Newest phantomas version HOT 3
- Gulp Plugin for phantomas HOT 8
- Add `--ignore-ssl-errors` option HOT 12
- Not able to install on MAC HOT 5
- phantomas: (254) Page loading failed HOT 7
- [email protected] Error HOT 15
- 252 Timeout when navigating to thetrainline.com HOT 5
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 grunt-phantomas.