File tree 3 files changed +32
-7
lines changed
3 files changed +32
-7
lines changed Original file line number Diff line number Diff line change
1
+ # Change Log
2
+
3
+ ## v0.0.4
4
+ 2020.10.31
5
+ - 複数サイトを1つの Heroku アプリでサービスメトリック採取できるように対応
6
+
7
+
8
+ ## v0.0.3
9
+ 2020.07.27
10
+ - 複数サイトのPVを同一グラフに表示する調整
11
+ - refs Pubs/Mackerel Ambassador (sogaoh) blogs/
12
+ - [ GoogleAnalyticsで取得したアクティブユーザー数を定期的にMackerelサービスメトリックに投稿する (1)] ( https://esa-pages.io/p/sharing/6641/posts/976/ebc3295116a84b02c966.html )
13
+ - [ GoogleAnalyticsで取得したアクティブユーザー数を定期的にMackerelサービスメトリックに投稿する (2)] ( https://esa-pages.io/p/sharing/6641/posts/979/7ba0cdf6e32419970274.html )
14
+
15
+ ## v0.0.2
16
+ 2020.07.27
17
+ - 単一サイト毎のサービスメトリック送信
18
+
19
+ ## v0.0.1
20
+ 2016.09.18
21
+ - [ a-know さんのオリジナル版公開] ( https://github.com/a-know/currentvisitor2mackerel )
22
+ - refs [ Google Analyticsの「現在の訪問人数」を Mackerel に投稿する heroku app を作ったよ - えいのうにっき] ( http://blog.a-know.me/entry/2016/09/19/162242 )
23
+
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ Post current visitor number of Google Analytics to [mackerel.io](https://mackere
4
4
## heroku app deploy button
5
5
[ ![ Deploy] ( https://www.herokucdn.com/deploy/button.svg )] ( https://heroku.com/deploy )
6
6
7
- ## How to use
7
+
8
+ ## References
8
9
In Japanese.
9
10
10
- [ Google Analyticsの「現在の訪問人数」を Mackerel に投稿する heroku app を作ったよ] ( http://blog.a-know.me/entry/2016/09/19/162242 )
11
+ [ GoogleAnalyticsで取得したアクティブユーザー数を定期的にMackerelサービスメトリックに投稿する の関連コード] ( https://github.com/sogaoh/mackerel-practice/tree/master/google-01 )
12
+ [ Google Analyticsの「現在の訪問人数」を Mackerel に投稿する heroku app を作ったよ - えいのうにっき] ( http://blog.a-know.me/entry/2016/09/19/162242 )
13
+
Original file line number Diff line number Diff line change 66
66
res = https . request ( req )
67
67
68
68
responses . store ( "#{ site } " , :result => { :status => res . code , :body => "#{ res . body } " } )
69
- # result_status = [result_status, res.code].max
69
+ result_status = [ result_status , res . code . to_i ] . max
70
70
end
71
71
end
72
72
end
73
73
74
74
headers 'Content-Type' => 'application/json'
75
- #status result_status
76
- status 200 # TODO:
75
+ status result_status
77
76
resp = {
78
77
body : responses ,
79
78
}
80
79
resp . to_json
81
80
end
82
81
83
- get '/test ' do
82
+ get '/sites ' do
84
83
site_and_view_id_json = JSON . parse ( ENV [ 'SITE_AND_VIEW_ID_JSON' ] )
85
84
86
85
site_and_view_id_json . each do |site_and_view_id |
87
86
site_and_view_id . each do |site , view_id |
88
- p "site=#{ site } 、 viewId=#{ view_id } "
87
+ p "site=#{ site } , viewId=#{ view_id } "
89
88
end
90
89
end
91
90
You can’t perform that action at this time.
0 commit comments