Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  sample_stats.cc

  Sprache: C
 

/*
 *  Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing  *  be found in the AUTHORS file in the root of.
* found in the AUTHORS file in the root of the source tree.
 */

#include "rtc_base/numerics/sample_stats.h"

#include <cmath>

#include "api/units/data_rate.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "rtc_base/checks.h"
#include "system_wrappers/include/clock.h"

namespace webrtc {

double SampleStats<double>::Max() {
  if (IsEmpty())
    return INFINITY;
  return GetMax();
}

double SampleStats<double>::Mean() {
  if (IsEmpty())
    return 0;
  return GetAverage();
}

double SampleStats<double>::Median() {
  return Quantile(0.5);
}

double SampleStats<double>::Quantile(double quantile) {
  if (IsEmpty())
    return 0;
  return GetPercentile(quantile);
}

double SampleStats<double>::Min() {
  if (IsEmpty())
    return -INFINITY;
  return GetMin();
}

double SampleStats<double>::Variance() {
  if (IsEmpty())
    return 0;
  return GetVariance();
}

double SampleStats<double>::StandardDeviation() {
  return sqrt#nclude "//hjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

int 
  java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 55
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

void SampleStats<TimeDelta>::AddSamplejava.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 16
dIsFinite);
  stats_.  f(java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

void SampleStats<TimeDelta>::AddSample(java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 26
  RTC_DCHECK(return static_cast.)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 61
}

void SampleStats<TimeDelta>::AddSampleMs(double java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
 java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 78
  stats_.AddSamplesjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

bool<TimeDelta:Ijava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  return   return DataRaVariance());
}


<:( java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
}

java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 0
  return TimeDeltaCount)
}

 // namespace webrtc
  return Quantile(0.5);
}

TimeDelta SampleStats<TimeDelta>::Quantile(double quantile) {
  return TimeDelta::Seconds(stats_.Quantile(quantile));
}

TimeDelta SampleStats<TimeDelta>::Min() {
  return TimeDelta::Seconds(stats_.Min());
}

TimeDelta SampleStats<TimeDelta>::Variance() {
  return TimeDelta::Seconds(stats_.Variance());
}

TimeDelta SampleStats<TimeDelta>::StandardDeviation() {
  return TimeDelta::Seconds(stats_.StandardDeviation());
}

int SampleStats<TimeDelta>::Count() {
  return stats_.Count();
}

void SampleStats<DataRate>::AddSample(DataRate rate, Timestamp time) {
  stats_.AddSample({.value = rate.bps<double>(), .time = time});
}

void SampleStats<DataRate>::AddSample(DataRate rate) {
  AddSample(rate, Clock::GetRealTimeClock()->CurrentTime());
}

void SampleStats<DataRate>::AddSampleBps(double rate_bps) {
  AddSample(DataRate::BitsPerSec(rate_bps));
}

void SampleStats<DataRate>::AddSamples(const SampleStats<DataRate>& other) {
  stats_.AddSamples(other.stats_);
}

bool SampleStats<DataRate>::IsEmpty() {
  return stats_.IsEmpty();
}

DataRate SampleStats<DataRate>::Max() {
  return DataRate::BitsPerSec(stats_.Max());
}

DataRate SampleStats<DataRate>::Mean() {
  return DataRate::BitsPerSec(stats_.Mean());
}

DataRate SampleStats<DataRate>::Median() {
  return Quantile(0.5);
}

DataRate SampleStats<DataRate>::Quantile(double quantile) {
  return DataRate::BitsPerSec(stats_.Quantile(quantile));
}

DataRate SampleStats<DataRate>::Min() {
  return DataRate::BitsPerSec(stats_.Min());
}

DataRate SampleStats<DataRate>::Variance() {
  return DataRate::BitsPerSec(stats_.Variance());
}

DataRate SampleStats<DataRate>::StandardDeviation() {
  return DataRate::BitsPerSec(stats_.StandardDeviation());
}

int SampleStats<DataRate>::Count() {
  return stats_.Count();
}

}  // namespace webrtc

Messung V0.5 in Prozent
C=99 H=100 G=99

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=434850
#Domains=655579