[statistics] fix statistics for diffs

This commit is contained in:
Arsentiy Milchakov 2019-02-21 16:37:25 +03:00 committed by Aleksey Belousov
parent e1c528ec5e
commit 78077de0a8
4 changed files with 8 additions and 9 deletions

View file

@ -33,8 +33,6 @@ char const * const kBookmarksBookmarkAction = "Bookmarks_Bookmark_action";
char const * const kPlacepageHotelBook = "Placepage_Hotel_book";
char const * const kEditorAddStart = "EditorAdd_start";
char const * const kEditorEditStart = "EditorEdit_start";
char const * const kDiffSchemeFallback = "Downloader_DiffScheme_OnStart_fallback";
char const * const kDiffSchemeError = "Downloader_DiffScheme_error";
// Settings.
char const * const kFrom = "utm_source";

View file

@ -38,8 +38,6 @@ extern char const * const kBookmarksBookmarkAction;
extern char const * const kPlacepageHotelBook;
extern char const * const kEditorAddStart;
extern char const * const kEditorEditStart;
extern char const * const kDiffSchemeFallback;
extern char const * const kDiffSchemeError;
// Settings.
extern char const * const kFrom;

View file

@ -8,6 +8,8 @@
#include "base/assert.hpp"
#include "base/cancellable.hpp"
#include "3party/Alohalytics/src/alohalytics.h"
namespace storage
{
namespace diffs
@ -30,7 +32,7 @@ void Manager::Load(LocalMapsInfo && info)
{
m_status = Status::NotAvailable;
GetPlatform().GetMarketingService().SendMarketingEvent(marketing::kDiffSchemeFallback, {});
alohalytics::Stats::Instance().LogEvent("Downloader_DiffScheme_OnStart_fallback");
}
else
{
@ -111,8 +113,8 @@ void Manager::ApplyDiff(ApplyDiffParams && p, base::Cancellable const & cancella
{
diffFile->DeleteFromDisk(MapOptions::Diff);
GetPlatform().GetMarketingService().SendMarketingEvent(
marketing::kDiffSchemeError,
alohalytics::Stats::Instance().LogEvent(
"Downloader_DiffScheme_error",
{{"type", "patching"},
{"error", isFilePrepared ? "Cannot apply diff" : "Cannot prepare file"}});

View file

@ -11,6 +11,7 @@
#include <unordered_map>
#include <utility>
#include "3party/Alohalytics/src/alohalytics.h"
#include "3party/jansson/myjansson.hpp"
#include "private.h"
@ -131,8 +132,8 @@ NameDiffInfoMap Checker::Check(LocalMapsInfo const & info)
ost << "Request to diffs server failed. Code = " << request.ErrorCode()
<< ", redirection = " << request.WasRedirected();
LOG(LINFO, (ost.str()));
GetPlatform().GetMarketingService().SendMarketingEvent(
marketing::kDiffSchemeError, {{"type", "network"}, {"error", ost.str()}});
alohalytics::Stats::Instance().LogEvent("Downloader_DiffScheme_error",
{{"type", "network"}, {"error", ost.str()}});
}
return diffs;