-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #16: Generate dashboards from experiments json definition in a…
… lambda handler.
- Loading branch information
Marina Samuel
committed
Jun 2, 2017
1 parent
543aeec
commit b1ff05c
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
|
||
from src.redash_client import RedashClient | ||
from src.utils import read_experiment_definition, format_date | ||
from src.dashboards.ActivityStreamExperimentDashboard import ( | ||
ActivityStreamExperimentDashboard) | ||
|
||
DIRECTORY_NAME = "experiments/json_definitions" | ||
FILENAME = "experiments2.json" | ||
|
||
|
||
def handler(): | ||
api_key = os.environ["REDASH_API_KEY"] | ||
redash_client = RedashClient(api_key) | ||
|
||
experiments = read_experiment_definition(FILENAME) | ||
print experiments | ||
for experiment in experiments: | ||
dash = ActivityStreamExperimentDashboard( | ||
redash_client, | ||
experiment["name"], | ||
experiment["variant"]["experiment_variant_slug"], | ||
experiment["addon_versions"], | ||
format_date(experiment["start_date"]), | ||
) | ||
|
||
dash.add_event_graphs(dash.DEFAULT_EVENTS) | ||
dash.add_event_graphs( | ||
dash.MASGA_EVENTS, events_table="activity_stream_masga") | ||
dash.add_events_per_user(dash.DEFAULT_EVENTS) | ||
dash.add_ttable() | ||
dash.update_refresh_schedule(43200) |