Skip to content

Commit

Permalink
chore: add telemetry to index rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Erichsen committed Aug 13, 2024
1 parent 6f69c5a commit cb41e49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gui/src/components/loaders/IndexingProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
setDialogMessage,
setShowDialog,
} from "../../redux/slices/uiStateSlice";
import { usePostHog } from "posthog-js/react";

const STATUS_COLORS = {
DISABLED: lightGray, // light gray
Expand Down Expand Up @@ -76,6 +77,7 @@ const IndexingProgressBar = ({
}: ProgressBarProps) => {
const dispatch = useDispatch();
const ideMessenger = useContext(IdeMessengerContext);
const posthog = usePostHog();

const [paused, setPaused] = useState<boolean | undefined>(undefined);
const [hovered, setHovered] = useState(false);
Expand Down Expand Up @@ -134,6 +136,7 @@ const IndexingProgressBar = ({
"less reliable for persistent issues."
}
onConfirm={() => {
posthog.capture("rebuild_index_clicked");
ideMessenger.post("index/forceReIndex", {
shouldClearIndexes: true,
});
Expand Down

0 comments on commit cb41e49

Please sign in to comment.