Skip to content

Commit

Permalink
395 updating the event names (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed May 4, 2022
1 parent db44986 commit 9433b0a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
14 changes: 7 additions & 7 deletions server/http/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (s *controller) CreateTest(ctx context.Context, test openapi.Test) (openapi
return openapi.Response(http.StatusInternalServerError, err.Error()), err
}

analytics.CreateAndSendEvent("test_created", "test")
analytics.CreateAndSendEvent("test-created-backend", "test")

test.TestId = id
return openapi.Response(200, test), nil
Expand All @@ -56,7 +56,7 @@ func (s *controller) UpdateTest(ctx context.Context, testid string, updated open
return openapi.Response(http.StatusInternalServerError, err.Error()), err
}

analytics.CreateAndSendEvent("test_updated", "test")
analytics.CreateAndSendEvent("test-updated-backend", "test")

return openapi.Response(204, nil), nil
}
Expand All @@ -77,7 +77,7 @@ func (s *controller) DeleteTest(ctx context.Context, testid string) (openapi.Imp
return openapi.Response(http.StatusInternalServerError, err.Error()), err
}

analytics.CreateAndSendEvent("test_deleted", "test")
analytics.CreateAndSendEvent("test-deleted-backend", "test")

return openapi.Response(204, nil), nil
}
Expand Down Expand Up @@ -126,7 +126,7 @@ func (s *controller) RunTest(ctx context.Context, testid string) (openapi.ImplRe

result := s.runner.Run(*test)

analytics.CreateAndSendEvent("test_run", "test")
analytics.CreateAndSendEvent("test-run-backend", "test")

return openapi.Response(200, result), nil
}
Expand Down Expand Up @@ -201,7 +201,7 @@ func (s *controller) CreateAssertion(ctx context.Context, testID string, asserti
return openapi.Response(http.StatusInternalServerError, err.Error()), err
}

analytics.CreateAndSendEvent("assertion_created", "test")
analytics.CreateAndSendEvent("assertion-created-backend", "test")

return openapi.Response(http.StatusOK, assertion), nil
}
Expand All @@ -219,7 +219,7 @@ func (s *controller) UpdateAssertion(ctx context.Context, testID string, asserti
return openapi.Response(http.StatusInternalServerError, err.Error()), err
}

analytics.CreateAndSendEvent("assertion_updated", "test")
analytics.CreateAndSendEvent("assertion-updated-backend", "test")

return openapi.Response(http.StatusNoContent, nil), nil
}
Expand All @@ -235,7 +235,7 @@ func (s *controller) DeleteAssertion(ctx context.Context, testID string, asserti
return openapi.Response(http.StatusInternalServerError, err.Error()), err
}

analytics.CreateAndSendEvent("assertion_deleted", "test")
analytics.CreateAndSendEvent("assertion-deleted-backend", "test")

return openapi.Response(http.StatusNoContent, nil), nil
}
Expand Down
2 changes: 1 addition & 1 deletion server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func main() {
}
})

err = analytics.CreateAndSendEvent("server_started", "beacon")
err = analytics.CreateAndSendEvent("server-started-backend", "beacon")
if err != nil {
log.Fatal(err)
}
Expand Down
1 change: 1 addition & 0 deletions web/src/services/Analytics/Analytics.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum Labels {
Modal = 'modal',
Table = 'table',
Form = 'form',
Tab = 'tab',
}

export const instance = new GA4React(measurementId);
Expand Down
2 changes: 1 addition & 1 deletion web/src/services/Analytics/TestAnalytics.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import AnalyticsService, {Categories} from './Analytics.service';

enum Actions {
RunTest = 'run-test-button-click',
TestRunClick = 'test-run-click',
TestRunClick = 'test-run-result-click',
}

type TTestAnalytics = {
Expand Down
4 changes: 2 additions & 2 deletions web/src/services/Analytics/TraceAnalytics.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AnalyticsService, { Categories, Labels } from "./Analytics.service";
import AnalyticsService, {Categories, Labels} from './Analytics.service';

enum Actions {
ChangeTab = 'change-tab',
Expand All @@ -16,7 +16,7 @@ const {event} = AnalyticsService(Categories.Trace);

const TraceAnalyticsService = (): TTraceAnalytics => {
const onChangeTab = (tabName: string) => {
event(Actions.ChangeTab, tabName);
event(`${Actions.ChangeTab}-${tabName}`, Labels.Table);
};

const onAddAssertionButtonClick = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AnalyticsService, {Categories} from './Analytics.service';

enum Actions {
ClickSpan = 'click-span-node',
ClickSpan = 'span-node-click',
}

type TTraceDiagramAnalytics = {
Expand Down

0 comments on commit 9433b0a

Please sign in to comment.