Skip to content

Commit 9dba52c

Browse files
Final touch ups
1 parent c3f271e commit 9dba52c

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

IntelPresentMon/Interprocess/source/metadata/EnumStat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
X_(STAT, MID_LERP, "Mid Lerp", "mlp", "Linear interpolation between the two observations nearest to the middle of the sliding window") \
1818
X_(STAT, NEWEST_POINT, "Newest Point", "npt", "Value in the most recent observation in the sliding window") \
1919
X_(STAT, OLDEST_POINT, "Oldest Point", "opt", "Value in the least recent observation in the sliding window") \
20-
X_(STAT, COUNT, "Count", "cnt", "Count of observations in the sliding window matching a predicate (e.g. counting # of observations for which a field is boolean true)")
21-
X_(STAT, NON_ZERO_AVG, "Non-zero Average", (const char*)u8"øavg", "Average or mean of frame samples over the sliding window, excluding all zero values")
20+
X_(STAT, COUNT, "Count", "cnt", "Count of observations in the sliding window matching a predicate (e.g. counting # of observations for which a field is boolean true)") \
21+
X_(STAT, NON_ZERO_AVG, "Non-zero Average", (const char*)u8"øavg", "Average or mean of frame samples over the sliding window, excluding all zero values")

IntelPresentMon/PMInstaller/PresentMon.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Id="*"
55
Name="Intel(R) PresentMon"
66
Language="1033"
7-
Version="0.7.0.0"
7+
Version="2.0.0.0"
88
Manufacturer="Intel(R) Corporation"
99
UpgradeCode="CD0D489E-0FE7-452D-90D9-F94F3F5FF410">
1010

IntelPresentMon/PresentMonMiddleware/source/ConcreteMiddleware.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <cassert>
88
#include <cstdlib>
99
#include <Shlwapi.h>
10+
#include <numeric>
1011
#include "../../PresentMonUtils/NamedPipeHelper.h"
1112
#include "../../PresentMonUtils/QPCUtils.h"
1213
#include "../../PresentMonAPI2/Internal.h"
@@ -1126,6 +1127,13 @@ void ReportMetrics(
11261127
output /= inData.size();
11271128
return;
11281129
}
1130+
else if (stat == PM_STAT_NON_ZERO_AVG)
1131+
{
1132+
std::vector<double> non_zero_data;
1133+
std::copy_if(inData.begin(), inData.end(), std::back_inserter(non_zero_data),
1134+
[](double value) { return value != 0.0; });
1135+
output = !non_zero_data.empty() ? std::accumulate(non_zero_data.begin(), non_zero_data.end(), 0.0) / non_zero_data.size() : 0.0;
1136+
}
11291137
else if (stat == PM_STAT_MID_POINT)
11301138
{
11311139
size_t middle_index = inData.size() / 2;

IntelPresentMon/Streamer/StreamClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ const PmNsmFrameData* StreamClient::PeekPreviousFrame()
228228

229229
PM_STATUS StreamClient::ConsumePtrToNextNsmFrameData(const PmNsmFrameData** pNsmData)
230230
{
231-
if (*pNsmData == nullptr) {
231+
if (pNsmData == nullptr) {
232232
return PM_STATUS::PM_STATUS_FAILURE;
233233
}
234234

0 commit comments

Comments
 (0)