<commit_before>////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
///     http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Dr. <NAME>
////////////////////////////////////////////////////////////////////////////////

#ifndef ARANGOD_STATISTICS_STATISTICS_H
#define ARANGOD_STATISTICS_STATISTICS_H 1

#include "Basics/Common.h"
#include "Rest/HttpRequest.h"
#include "Statistics/figures.h"

struct TRI_request_statistics_t {
#ifdef USE_DEV_TIMERS
  static thread_local TRI_request_statistics_t* STATS;
#endif

  TRI_request_statistics_t()
      : _readStart(0.0),
        _readEnd(0.0),
        _queueStart(0.0),
        _queueEnd(0.0),
        _requestStart(0.0),
        _requestEnd(0.0),
        _writeStart(0.0),
        _writeEnd(0.0),
        _receivedBytes(0.0),
        _sentBytes(0.0),
        _requestType(arangodb::rest::RequestType::ILLEGAL),
        _async(false),
        _tooLarge(false),
        _executeError(false),
        _ignore(false) {
#ifdef USE_DEV_TIMERS
    _id = nullptr;
#endif
  }

  void reset() {
    _readStart = 0.0;
    _readEnd = 0.0;
    _queueStart = 0.0;
    _queueEnd = 0.0;
    _requestStart = 0.0;
    _requestEnd = 0.0;
    _writeStart = 0.0;
    _writeEnd = 0.0;
    _receivedBytes = 0.0;
    _sentBytes = 0.0;
    _requestType = arangodb::rest::RequestType::ILLEGAL;
    _async = false;
    _tooLarge = false;
    _executeError = false;
    _ignore = false;
#ifdef USE_DEV_TIMERS
    _sections.clear();
    _timings.clear();
#endif
  }

  double _readStart;
  double _readEnd;
  double _queueStart;
  double _queueEnd;
  double _requestStart;
  double _requestEnd;
  double _writeStart;
  double _writeEnd;

  double _receivedBytes;
  double _sentBytes;
<commit_msg>add comments to statistics members<commit_after>////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
///     http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Dr. <NAME>
////////////////////////////////////////////////////////////////////////////////

#ifndef ARANGOD_STATISTICS_STATISTICS_H
#define ARANGOD_STATISTICS_STATISTICS_H 1

#include "Basics/Common.h"
#include "Rest/HttpRequest.h"
#include "Statistics/figures.h"

struct TRI_request_statistics_t {
#ifdef USE_DEV_TIMERS
  static thread_local TRI_request_statistics_t* STATS;
#endif

  TRI_request_statistics_t()
      : _readStart(0.0),
        _readEnd(0.0),
        _queueStart(0.0),
        _queueEnd(0.0),
        _requestStart(0.0),
        _requestEnd(0.0),
        _writeStart(0.0),
        _writeEnd(0.0),
        _receivedBytes(0.0),
        _sentBytes(0.0),
        _requestType(arangodb::rest::RequestType::ILLEGAL),
        _async(false),
        _tooLarge(false),
        _executeError(false),
        _ignore(false) {
#ifdef USE_DEV_TIMERS
    _id = nullptr;
#endif
  }

  void reset() {
    _readStart = 0.0;
    _readEnd = 0.0;
    _queueStart = 0.0;
    _queueEnd = 0.0;
    _requestStart = 0.0;
    _requestEnd = 0.0;
    _writeStart = 0.0;
    _writeEnd = 0.0;
    _receivedBytes = 0.0;
    _sentBytes = 0.0;
    _requestType = arangodb::rest::RequestType::ILLEGAL;
    _async = false;
    _tooLarge = false;
    _executeError = false;
    _ignore = false;
#ifdef USE_DEV_TIMERS
    _sections.clear();
    _timings.clear();
#endif
  }

  double _readStart;     // CommTask::processRead - read first byte of message
  double _readEnd;       // CommTask::processRead - message complete
  double _queueStart;    // addJob to queue GeneralServer::handleRequest
  double _queueEnd;      // exit queue DispatcherThread::handleJob
  double _requestStart;  // GeneralServerJob::work
  double _requestEnd;
  double _writeStart;
  double _writeEnd;

  double _receivedBytes;
  double _sentBytes;

{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.023588553750966745, 'mean_word_length': 2.3722294654498044, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '794513', 'n_tokens_mistral': 1673, 'n_tokens_neox': 1569, 'n_words': 421}