-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.yaml
64 lines (55 loc) · 1.98 KB
/
example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Run the following command to see how metrics defined below are collected:
#
# MIKE_CONFIG=example.yaml collect_metrics
# dashboard name
name: "The Example dashboard"
# first, we specify settings for generic sources like Jira and MySQL
# they need credentials and host name
sources: []
# where will metrics be stored
storage:
engine: mysql
host: ''
database: ''
user: ''
password: ''
# now define metrics that are taken from sources above
metrics:
- name: lubimy_czytac/rating
source: http/xpath # use the base source directly here
url: "http://lubimyczytac.pl/ksiazka/{book_id}"
xpath: '//*[@itemprop="aggregateRating"]//*[@itemprop="ratingValue"]'
label: "Book rating: %d"
- name: lubimy_czytac/wants_to_read
source: http/xpath # use the base source directly here
url: "http://lubimyczytac.pl/ksiazka/{book_id}"
xpath: '//*[@id="ajaxShelfsBox"]//*[@data-shelf-id-counter="3"]'
label: "Wants to read: %d"
- name: wikipedia/stats
source: http/json # let's use the base source directly here
url: "https://{wikipedia_domain}.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=statistics&format=json"
jq: ".query.statistics.{stats_field}"
label: "{wikipedia_domain} Wikipedia {stats_field}: %d"
# these keys will be copied to each feature defined below
common:
metrics:
- name: lubimy_czytac/rating
# now features "score" will be calculated using the metrics defined above with per-feature parameters set
features:
- name: PanTadeusz
url: "http://lubimyczytac.pl/ksiazka/4871036/pan-tadeusz"
template:
book_id: 4871036
metrics:
# additional metric just for this book
- name: lubimy_czytac/wants_to_read
- name: "Wojna i Pókój"
url: "http://lubimyczytac.pl/ksiazka/4869384/wojna-i-pokoj-tom-1"
template:
book_id: 4869384
- name: PolishWikipedia
template:
wikipedia_domain: pl
stats_field: "articles"
metrics:
- name: wikipedia/stats