[FR] Do not necessarily print "s" or "/s" for custom counters tagged as rate
Los mantenedores suelen responder en 1 día
@Chaturvediharsh123 ya está trabajando en esto.
Desde el 2/10/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp
- Área
- performance
Línea de trabajo
Comienza con la lógica de formateo de tasas en src/console_reporter.cc enlazada por el issue y, después, sigue el enum de flags de Counter y cómo se representan los contadores personalizados. El cambio estará completo cuando un contador de tasa que use kHasNoUnit se imprima sin un sufijo "/s" automático, mientras que los demás contadores de tasa conserven su formato actual.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
I would like to have a new column in my benchmark report presenting the number of operations per dollar. I have a constant value that I know, which is the cost per second. The calculation I want in that column is given by the formula:
number_of_iterations / (cost_per_second * total_execution_time_in_seconds)
I think I can obtain the number of iterations using the iterations() function in the state object, but I couldn't find a way to recover the total execution time. The only way I found to do that calculation is by adding a new counter with 1 / cost_per_second and tag it as benchmark::Counter::kIsIterationInvariantRate
state.counters["Throughput"] = benchmark::Counter(
1 / cost_per_second,
benchmark::Counter::kIsIterationInvariantRate
);
This will multiply 1 / cost_per_second by number_of_iterations / total_execution_time_in_seconds and will give me the exact value I want. However, since I'm using a kIsRate variant, it will always append "/s" to that value when I print the report in the console. This is wrong. The unit, in this case, would be "OP/$".
Describe the solution you'd like
Implement a new element in the enum kHasNoUnit and don't append the "/s" in case it is in use.
state.counters["Throughput"] = benchmark::Counter(
1 / cost_per_second,
benchmark::Counter::kIsIterationInvariantRate | benchmark::Counter::kHasNoUnit
);
Describe alternatives you've considered
Another option would be to simply enable the user to define a custom unit to the counter. In this case, I would set "OP/$".
- Lenguaje dominante
- C++
- Estrellas
- 10.5k
- Forks
- 1.8k
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 28
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/benchmark
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[BUG] Memory manager counts allocations not part of benchmarkQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
google/benchmark#2149 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
[FR] New "benchstat" output formatPosiblemente ocupada @DenysZm la tomó hace 5 días. Abierto
google/benchmark#2397 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
google/benchmark#2391 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[FR] Add native Zig bindings via top-level `bindings/zig`Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
google/benchmark#2266 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de google/benchmark
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
FreqScanner: Run with no enabled frequencies silently stalls in START_SCAN and keeps stale power resultsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
component: tabs platform: macOS
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
zen-browser/desktop#16860 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
metasequoiaime/msime#12003 ·
Los mantenedores suelen responder en 1 día