Skip to content

Commit

Permalink
refactor(chalice): removed sessions insights
Browse files Browse the repository at this point in the history
  • Loading branch information
tahayk committed Dec 4, 2024
1 parent df621aa commit 7cafe3c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 486 deletions.
12 changes: 1 addition & 11 deletions ee/api/chalicelib/core/custom_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from fastapi import HTTPException, status

import schemas
from chalicelib.core import funnels, issues, heatmaps, sessions_insights, sessions_mobs, sessions_favorite, \
from chalicelib.core import funnels, issues, heatmaps, sessions_mobs, sessions_favorite, \
product_analytics, custom_metrics_predefined
from chalicelib.utils import helper, pg_client
from chalicelib.utils.TimeUTC import TimeUTC
Expand Down Expand Up @@ -95,15 +95,6 @@ def __get_heat_map_chart(project: schemas.ProjectContext, user_id, data: schemas
include_mobs=include_mobs)


# EE only
def __get_insights_chart(project: schemas.ProjectContext, data: schemas.CardInsights, user_id: int = None):
return sessions_insights.fetch_selected(project_id=project.project_id,
data=schemas.GetInsightsSchema(startTimestamp=data.startTimestamp,
endTimestamp=data.endTimestamp,
metricValue=data.metric_value,
series=data.series))


def __get_path_analysis_chart(project: schemas.ProjectContext, user_id: int, data: schemas.CardPathAnalysis):
if len(data.series) == 0:
data.series.append(
Expand Down Expand Up @@ -195,7 +186,6 @@ def get_chart(project: schemas.ProjectContext, data: schemas.CardSchema, user_id
schemas.MetricType.TABLE: __get_table_chart,
schemas.MetricType.HEAT_MAP: __get_heat_map_chart,
schemas.MetricType.FUNNEL: __get_funnel_chart,
schemas.MetricType.INSIGHTS: __get_insights_chart,
schemas.MetricType.PATH_ANALYSIS: __get_path_analysis_chart
}
return supported.get(data.metric_type, not_supported)(project=project, data=data, user_id=user_id)
Expand Down
Loading

0 comments on commit 7cafe3c

Please sign in to comment.