1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_ASH_COMPONENTS_GROWTH_GROWTH_METRICS_H_
#define CHROMEOS_ASH_COMPONENTS_GROWTH_GROWTH_METRICS_H_
#include "base/component_export.h"
#include "chromeos/ash/components/growth/campaigns_model.h"
namespace base {
class TimeDelta;
} // namespace base
namespace growth {
// These enum values represent user-facing errors in the campaigns loading and
// matching flow. Entries should not be renumbered and numeric values should
// never be reused. Please keep in sync with "CampaignsManagerError" in
// src/tools/metrics/histograms/metadata/ash_growth/enums.xml.
enum class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_GROWTH)
CampaignsManagerError {
kCampaignsComponentLoadFail = 0,
kCampaignsFileLoadFail = 1,
kCampaignsParsingFail = 2,
kUserPrefUnavailableAtMatching = 3,
kInvalidCampaign = 4,
kInvalidTargeting = 5,
kInvalidSchedulingTargeting = 6,
kInvalidScheduling = 7,
kDemoModeAppVersionUnavailable = 8,
kSerializingDemoModePayloadFail = 9,
kOpenUrlParamsParsingFail = 10,
kMissingActionType = 11,
kInvalidAppTargeting = 12,
kInvalidAnchorType = 13,
kUnrecognizedBuiltInIcon = 14,
kMissingCampaignId = 15,
kInvalidAction = 16,
kPerformActionFailed = 17,
kInvalidEventTargetingCondition = 18,
kInvalidEventTargetingConditionParam = 19,
kNoOpendedWindowToAnchor = 20,
kNoOpendedWindowWidgetToAnchor = 21,
kNoRootViewToGetAnchorView = 22,
kNudgePayloadInvalidImage = 23,
kNudgePayloadMissingBody = 24,
kNudgeAnchorViewNotFound = 25,
kNotificationPayloadMissingIcon = 26,
kNotificationPayloadInvalidIcon = 27,
kNotificationPayloadInvalidButton = 28,
kNotificationPayloadMissingButtonLabel = 29,
kNotificationPayloadMissingButtonAction = 30,
kInvalidNotificationPayload = 31,
kInvalidTrigger = 32,
kNudgeAnchorWidgetNotFound = 33,
kNudgeAnchorPositionNotSupported = 34,
kTrackerInitializationFail = 35,
kTrackerNotAvailableInSession = 36,
kUserPrefServiceNotAvailable = 37,
kUserPrefValueTypeMismatch = 38,
kUserPrefNotFound = 39,
kTargetingUserPrefNotFound = 40,
kTargetingUserPrefParsingFail = 41,
kMissingActionPerformerAction = 42,
kUnknownMinorUserState = 43,
kNullptrProfile = 44,
kShelfInvisibleAtMatching = 45,
kHotseatInvisibleAtMatching = 46,
kShelfViewNotAvailableAtMatching = 47,
kHotseatAppIconNotPresent = 48,
kRecordEventBeforeCampaignsLoaded = 49,
kNudgeSheflIconAnchorViewNotFound = 50,
kNoBoardInfo = 51,
kFeatureIndexOutOfRange = 52,
kInvalidUrlRegrex = 53,
kUnrecognizedBuiltInImage = 54,
kMissingBuiltInVectorIcon = 55,
kMaxValue = kMissingBuiltInVectorIcon,
};
// Records errors encountered during the campaigns loading and matching flow.
COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_GROWTH)
void RecordCampaignsManagerError(CampaignsManagerError error_code);
// Records how many times a campaign will be fetched for the given `slot`.
void RecordGetCampaignBySlotAttempt(Slot slot);
// Records how many times a campaign is fetched for the given `slot`.
// Also records the fetched campaign's id.
void RecordGetCampaignBySlot(Slot slot, int campaign_id);
void RecordCampaignsComponentDownloadDuration(const base::TimeDelta duration,
bool in_oobe);
void RecordCampaignsComponentReadDuration(const base::TimeDelta duration);
void RecordCampaignMatchDuration(const base::TimeDelta duration);
} // namespace growth
#endif // CHROMEOS_ASH_COMPONENTS_GROWTH_GROWTH_METRICS_H_
|