Created
February 6, 2015 03:37
-
-
Save yujihamaguchi/4e1cba4b83ba154cb2fd to your computer and use it in GitHub Desktop.
[Tableau Server] レポートの表示時間を取得する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --------------------------------------------------------------------------------------------- | |
| -- 以下を実行し、レポート表示に要した時間を取得する。 | |
| -- (Tableau Server データベースへの接続に関しては下記を参照) | |
| -- http://onlinehelp.tableau.com/current/server/ja-jp/help.htm#adminview_postgres.htm%3FTocPath%3D%25E7%25AE%25A1%25E7%2590%2586%25E8%2580%2585%25E3%2582%25AC%25E3%2582%25A4%25E3%2583%2589%7C%25E3%2582%25B5%25E3%2583%25BC%25E3%2583%2590%25E3%2583%25BC%25E3%2581%25AE%25E6%2593%258D%25E4%25BD%259C%7C%25E3%2582%25AB%25E3%2582%25B9%25E3%2582%25BF%25E3%2583%25A0%25E7%25AE%25A1%25E7%2590%2586%25E3%2583%2593%25E3%2583%25A5%25E3%2583%25BC%25E3%2581%25AE%25E4%25BD%259C%25E6%2588%2590%7C_____0 | |
| --------------------------------------------------------------------------------------------- | |
| SELECT | |
| r2.name AS site_name | |
| ,r1.currentsheet AS report_name | |
| ,r1.vizql_session AS session_id | |
| ,MIN(r1.created_at) AS created_at | |
| ,DATE_PART('minute', MAX(r1.completed_at) - MIN(r1.created_at)) * 60 + DATE_PART('second', MAX(r1.completed_at) - MIN(r1.created_at)) AS elapsed_time | |
| FROM | |
| _http_requests r1 | |
| INNER JOIN | |
| _sites r2 | |
| ON | |
| r1.site_id = r2.id | |
| AND r2.name = '{サイト名}' | |
| AND r1.currentsheet = '{表示レポート名(*1)}' | |
| AND r1.created_at >= (TO_TIMESTAMP('{レポート表示開始時刻}', 'YYYY-MM-DD HH24:MI:SS') - INTERVAL '9 hour') | |
| LEFT OUTER JOIN | |
| _users r3 | |
| ON | |
| r1.user_id = r3.id | |
| AND r3.name = '{Tableau Server ログインユーザID(*2)}' | |
| GROUP BY | |
| r2.name | |
| ,r1.currentsheet | |
| ,r1.vizql_session | |
| --------------------------------------------------------------------------------------------- | |
| -- *1 以下の"{ワークブック名}/{シート名}"の部分 | |
| -- | |
| -- http://{Tableu Server ホスト名}:{ポート}/t/{サイト名}/views/{ワークブック名}/{シート名} | |
| -- | |
| -- *3 レポートにアクセスしたTableu ServerのユーザID | |
| --------------------------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment