chromium/components/metrics/psi_memory_parser_linux.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/metrics/psi_memory_parser.h"

#include <stddef.h>

#include <cinttypes>
#include <map>
#include <memory>
#include <string>
#include <string_view>

#include "base/metrics/histogram.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "components/metrics/metrics_log_store.h"

namespace metrics {

namespace {

// Periods supported by standard Linux PSI metricvs.
constexpr uint32_t kMinCollectionInterval =;
constexpr uint32_t kMidCollectionInterval =;
constexpr uint32_t kMaxCollectionInterval =;

constexpr uint32_t kDefaultCollectionInterval =;

// Name of the histogram that represents the success and various failure modes
// for parsing PSI memory data.
const char kParsePSIMemoryHistogramName[] =;

constexpr std::string_view kContentPrefixSome =;
constexpr std::string_view kContentPrefixFull =;
constexpr std::string_view kContentTerminator =;
constexpr std::string_view kMetricTerminator =;

const char kMetricPrefixFormat[] =;

}  // namespace

PSIMemoryParser::PSIMemoryParser(uint32_t period)
    :{}

PSIMemoryParser::~PSIMemoryParser() = default;

uint32_t PSIMemoryParser::GetPeriod() const {}

int PSIMemoryParser::GetMetricValue(std::string_view content,
                                    size_t start,
                                    size_t end) {}

void PSIMemoryParser::LogParseStatus(ParsePSIMemStatus stat) {}

ParsePSIMemStatus PSIMemoryParser::ParseMetrics(std::string_view content,
                                                int* metric_some,
                                                int* metric_full) {}

namespace internal {

bool FindMiddleString(std::string_view content,
                      size_t search_start,
                      std::string_view prefix,
                      std::string_view suffix,
                      size_t* start,
                      size_t* end) {}

}  // namespace internal

}  // namespace metrics