项目作者: mycaule

项目描述 :
Plan rowing sessions with your friends
高级语言: JavaScript
项目地址: git://github.com/mycaule/can-we-row.git
创建时间: 2015-06-15T21:09:38Z
项目社区:https://github.com/mycaule/can-we-row

开源协议:MIT License

下载



Can we row?


Build Status
dependencies Status
devDependencies Status




A simple webapp for rowers to check if they can row based on different time-series metrics (water levels, weather).

The project uses French government dataset on rivers activity.

It is available for the following French cities: Amiens, Besançon, Bordeaux, Caen, Châlons-en-Champagne, Clermont-Ferrand, Dijon, Lille, Limoges, Lyon, Marseille, Metz, Montpellier, Nantes, Orléans, Paris, Poitiers, Rennes, Rouen, Strasbourg, Toulouse.

Open an issue if the data is incorrect or if you want your city to appear on the list. You can also check the roadmap for this application.

I hope you have lots of fun using it!

Setup

The web application serves a /metrics endpoint to scrape historical data and to expose latest to the Prometheus monitoring system. A summary of the latest data can be obtained using /latest.

Routes

GET /metrics/hauteurs?stations=...

  1. # HELP hauteurs Observations par hauteur H
  2. # TYPE hauteurs gauge
  3. hauteurs{station="F700000103"} 1.46 1512993000000
  4. hauteurs{station="M800001010"} 5.26 1512994800000
  5. hauteurs{station="O222251001"} -0.18 1512995400000
  6. hauteurs{station="U472002001"} 2.32 1512993600000
  7. hauteurs{station="O972001001"} 5.23 1512995400000
  8. hauteurs{station="A060005050"} 2.87 1512993600000

GET /metrics/temperatures?cities=...

  1. # HELP temperatures Températures
  2. # TYPE temperatures gauge
  3. temperatures{city="paris"} 5.56 1513008710000
  4. temperatures{city="lyon"} 7.46 1513008710000

GET /latest/temperatures?cities=...

  1. [{
  2. city: "paris",
  3. time: 1513086316000,
  4. meas: 5.63
  5. }, {
  6. city: "lyon",
  7. time: 1513086316000,
  8. meas: 5.44
  9. }]

GET /latest/hauteurs?stations=...

  1. [{
  2. station: "F700000103",
  3. time: 1513083000000,
  4. meas: 1.89
  5. }, {
  6. station: "U472002001",
  7. time: 1513080000000,
  8. meas: 2.32
  9. }, {
  10. station: "O972001001",
  11. time: 1513083300000,
  12. meas: 4.59
  13. }, {
  14. station: "M800001010",
  15. time: 1513081200000,
  16. meas: 5.46
  17. }, {
  18. station: "O222251001",
  19. time: 1513082700000,
  20. meas: -0.39
  21. }, {
  22. station: "A060005050",
  23. time: 1513080000000,
  24. meas: 3.07
  25. }]

Setting up API keys

Go to darksky.net to get a developer access to their API. Then, make sure to set process.env.DARKSKY_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' before running the web server.

Vigicrues doesn’t need an API key.

Running a Prometheus instance

  1. docker run --name prometheus -d -p 127.0.0.1:9090:9090 quay.io/prometheus/prometheus

Configuring the Prometheus scrapers.

  1. # Login into the docker instance
  2. docker exec -it prometheus sh
  3. # Edit the config file to match our template /config/prometheus.yml
  4. vi /etc/prometheus/prometheus.yml
  5. # Get the pid for prometheus
  6. ps -ef
  7. # Reload Prometheus configuration
  8. kill -HUP [pid]

Contributions

Changes and improvements are welcome! Feel free to fork and open a pull request into master.

Roadmap

License

can-we-row is licensed under the MIT License.

References

Data sources

Application

Usability