Commit 612d8837 authored by Thanh Nguyen's avatar Thanh Nguyen Committed by Commit Bot

[offline-model] Move SearchRankingEventLogger to search_result_ranker

This CL doesn't change any logic. It moves SearchRankingEventLogger to
search_result_ranker, which is a more suitable place. The proto is
deleted because it's not currently being used.

This CL will be followed by several CLs that refactors the class.

Bug: 1006133
Change-Id: I1b9180a6b9613d0627a1a00ca8cf55204c4987b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816058Reviewed-by: default avatarJenny Zhang <jennyz@chromium.org>
Commit-Queue: Thanh Nguyen <thanhdng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699911}
parent 569fb284
......@@ -3492,8 +3492,6 @@ jumbo_split_static_library("ui") {
"app_list/search/drive_quick_access_result.h",
"app_list/search/extension_app_result.cc",
"app_list/search/extension_app_result.h",
"app_list/search/logging/search_ranking_event_logger.cc",
"app_list/search/logging/search_ranking_event_logger.h",
"app_list/search/mixer.cc",
"app_list/search/mixer.h",
"app_list/search/omnibox_provider.cc",
......@@ -3538,6 +3536,8 @@ jumbo_split_static_library("ui") {
"app_list/search/search_result_ranker/recurrence_ranker.h",
"app_list/search/search_result_ranker/recurrence_ranker_util.cc",
"app_list/search/search_result_ranker/recurrence_ranker_util.h",
"app_list/search/search_result_ranker/search_ranking_event_logger.cc",
"app_list/search/search_result_ranker/search_ranking_event_logger.h",
"app_list/search/search_result_ranker/search_result_ranker.cc",
"app_list/search/search_result_ranker/search_result_ranker.h",
"app_list/search/search_utils/fuzzy_tokenized_string_match.cc",
......@@ -3561,7 +3561,6 @@ jumbo_split_static_library("ui") {
"//ash/app_list",
"//ash/public/cpp/app_list/vector_icons",
"//ash/resources/vector_icons",
"//chrome/browser/ui/app_list/search/logging:search_ranking_event_proto",
"//chrome/browser/ui/app_list/search/search_result_ranker:app_launch_event_logger_proto",
"//chrome/browser/ui/app_list/search/search_result_ranker:app_launch_predictor_proto",
"//chrome/browser/ui/app_list/search/search_result_ranker:app_list_launch_recorder_proto",
......
......@@ -21,7 +21,7 @@
#include "base/memory/weak_ptr.h"
#include "base/scoped_observer.h"
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ui/app_list/search/logging/search_ranking_event_logger.h"
#include "chrome/browser/ui/app_list/search/search_result_ranker/search_ranking_event_logger.h"
#include "components/search_engines/template_url_service.h"
#include "components/search_engines/template_url_service_observer.h"
#include "components/user_manager/user_manager.h"
......
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//third_party/protobuf/proto_library.gni")
proto_library("search_ranking_event_proto") {
sources = [
"search_ranking_event.proto",
]
}
jiameng@chromium.org
# COMPONENT: UI>Shell>Launcher
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package app_list;
// Some enums that will be used for both SearchRankingZeroStateEvent and
// SearchRankingQueryEvent.
enum CategoryID {
UNKNOWN_CATEGORY_ID = 0;
ANSWER_CARD = 1;
RECENT_QUERY = 2;
WEB_RESULT = 3;
BOOKMARK = 4;
RECENTLY_VISITED_URL = 5;
DRIVE_FILE = 6;
LOCAL_FILE = 7;
}
enum FileExtension {
UNKNOWN_FILE_EXTENSION = 0;
DOCS = 1;
SHEETS = 2;
SLIDES = 3;
FORMS = 4;
DRAWINGS = 5;
}
enum DayOfWeek {
SUN = 0;
MON = 1;
TUE = 2;
WED = 3;
THU = 4;
FRI = 5;
SAT = 6;
}
enum DeviceMode {
CLAMSHELL = 0;
TABLET = 1;
}
// SearchRankingZeroStateEvent contains features and related information for the
// Chrome OS Search and Ranking project. These will be used for zero-state
// recommendations.
message SearchRankingZeroStateEvent {
// Contain features about a specific item.
message Features {
// Type of the item.
optional CategoryID category_id = 1;
// Extension of the file. Only available if category_id is DRIVE_FILE or
// LOCAL_FILE.
optional FileExtension file_extension = 2;
// Day of the week. Sunday is 0.
optional DayOfWeek day_of_week = 3;
// Position of the item. Topmost is position 1.
optional int32 position = 4;
// Last usage time as hours since midnight in the local time zone. For
// previous queries, it is the time the user clicked on it on the
// same Chrome device.
optional int32 last_usage_time = 5;
// Time since the item was last used/clicked. This is a duration timestamp
// and will be in seconds.
optional int32 time_since_last_use = 6;
// Number of clicks each hour as bucketed by the hour.
optional int32 num_clicks_each_hour = 7;
// Physical device mode, e.g. TABLET, CLAMSHELL.
optional DeviceMode device_mode = 8;
// Bucketed previous query length
optional int32 query_length = 9;
}
// Information related to a specific event.
message Event {
// Identifier used to associate all recommended items that were shown to the
// user.
optional int32 event_id = 1;
// Event time as hours since midnight in the local time zone. This is
// absolute timestamp and will be in hours.
optional int32 event_time = 2;
// Whether the item is clicked.
optional bool is_clicked = 3;
}
optional Features features = 1;
optional Event event = 2;
}
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/app_list/search/logging/search_ranking_event_logger.h"
#include "chrome/browser/ui/app_list/search/search_result_ranker/search_ranking_event_logger.h"
#include <cmath>
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_LOGGING_SEARCH_RANKING_EVENT_LOGGER_H_
#define CHROME_BROWSER_UI_APP_LIST_SEARCH_LOGGING_SEARCH_RANKING_EVENT_LOGGER_H_
#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_RESULT_RANKER_SEARCH_RANKING_EVENT_LOGGER_H_
#define CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_RESULT_RANKER_SEARCH_RANKING_EVENT_LOGGER_H_
#include <map>
#include <string>
......@@ -117,4 +117,4 @@ class SearchRankingEventLogger {
} // namespace app_list
#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_LOGGING_SEARCH_RANKING_EVENT_LOGGER_H_
#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_RESULT_RANKER_SEARCH_RANKING_EVENT_LOGGER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/app_list/search/logging/search_ranking_event_logger.h"
#include "chrome/browser/ui/app_list/search/search_result_ranker/search_ranking_event_logger.h"
#include <map>
#include <memory>
......
......@@ -5135,7 +5135,6 @@ test("unit_tests") {
"../browser/ui/app_list/search/arc/arc_playstore_search_provider_unittest.cc",
"../browser/ui/app_list/search/common/file_icon_util_unittest.cc",
"../browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_unittest.cc",
"../browser/ui/app_list/search/logging/search_ranking_event_logger_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/app_launch_event_logger_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/app_launch_predictor_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/app_list_launch_metrics_provider_unittest.cc",
......@@ -5147,6 +5146,7 @@ test("unit_tests") {
"../browser/ui/app_list/search/search_result_ranker/recurrence_predictor_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/recurrence_ranker_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/recurrence_ranker_util_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/search_ranking_event_logger_unittest.cc",
"../browser/ui/app_list/search/search_result_ranker/search_result_ranker_unittest.cc",
"../browser/ui/app_list/search/search_utils/fuzzy_tokenized_string_match_unittest.cc",
"../browser/ui/app_list/search/search_utils/sequence_matcher_unittest.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment