https://github.com/accessd/awesome-report
https://github.com/accessd/awesome-report
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/accessd/awesome-report
- Owner: accessd
- Created: 2020-07-24T13:28:27.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T20:53:08.000Z (about 5 years ago)
- Last Synced: 2025-02-20T21:02:04.940Z (over 1 year ago)
- Language: Ruby
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Awesome Report
## DESCRIPTION
Create awesome report in json format from raw data like:
```
user,0,Leida,Cira,0
session,0,0,Safari 29,87,2016-10-23
session,0,1,Firefox 12,118,2017-02-27
session,0,2,Internet Explorer 28,31,2017-03-28
session,0,3,Internet Explorer 28,109,2016-09-15
session,0,4,Safari 39,104,2017-09-27
session,0,5,Internet Explorer 35,6,2016-09-01
user,1,Palmer,Katrina,65
session,1,0,Safari 17,12,2016-10-21
session,1,1,Firefox 32,3,2016-12-20
session,1,2,Chrome 6,59,2016-11-11
session,1,3,Internet Explorer 10,28,2017-04-29
session,1,4,Chrome 13,116,2016-12-28
```
## USAGE
Install gems with:
bundle install
Create report with:
bin/report ./data/data.txt result.json
Reports store in `reports` dir.
## PERFORMANCE OPTIMIZATION
* Read file line by line: `File.new(file_path).each`
* Use bang methods, for example `sort!` instead `sort`
* Free objects in collection while iterating over them: `user = collector.users.shift[1]`
* Avoid to use `Date.parse`
* Use cache in instance methods