predictor_config.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_ASSIST_RANKER_PREDICTOR_CONFIG_H_
  5. #define COMPONENTS_ASSIST_RANKER_PREDICTOR_CONFIG_H_
  6. #include <string>
  7. #include "base/containers/flat_set.h"
  8. #include "base/metrics/field_trial_params.h"
  9. namespace assist_ranker {
  10. // TODO(chrome-ranker-team): Implement other logging types.
  11. enum LogType {
  12. LOG_NONE = 0,
  13. LOG_UKM = 1,
  14. };
  15. // Empty feature allowlist used for testing.
  16. const base::flat_set<std::string>* GetEmptyAllowlist();
  17. // This struct holds the config options for logging, loading and field trial
  18. // for a predictor.
  19. struct PredictorConfig {
  20. PredictorConfig(const char* model_name,
  21. const char* logging_name,
  22. const char* uma_prefix,
  23. const LogType log_type,
  24. const base::flat_set<std::string>* feature_allowlist,
  25. const base::Feature* field_trial,
  26. const base::FeatureParam<std::string>* field_trial_url_param,
  27. float field_trial_threshold_replacement_param)
  28. : model_name(model_name),
  29. logging_name(logging_name),
  30. uma_prefix(uma_prefix),
  31. log_type(log_type),
  32. feature_allowlist(feature_allowlist),
  33. field_trial(field_trial),
  34. field_trial_url_param(field_trial_url_param),
  35. field_trial_threshold_replacement_param(
  36. field_trial_threshold_replacement_param) {}
  37. const char* const model_name;
  38. const char* const logging_name;
  39. const char* const uma_prefix;
  40. const LogType log_type;
  41. const base::flat_set<std::string>* feature_allowlist;
  42. const base::Feature* field_trial;
  43. const base::FeatureParam<std::string>* field_trial_url_param;
  44. const float field_trial_threshold_replacement_param;
  45. };
  46. } // namespace assist_ranker
  47. #endif // COMPONENTS_ASSIST_RANKER_PREDICTOR_CONFIG_H_