Skip to content

Commit bf2a9f2

Browse files
author
Vincent Thiery
committed
Merge branch 'release/0.0.4'
2 parents 438ac41 + 4eba28d commit bf2a9f2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
66

77
install(FILES src/* DESTINATION include)
88

9-
find_package (Threads)
9+
find_package(Threads)
1010
add_executable(testStatsdClient ${CMAKE_CURRENT_SOURCE_DIR}/tests/testStatsdClient.cpp)
1111
target_link_libraries(testStatsdClient ${CMAKE_THREAD_LIBS_INIT})
1212

src/StatsdClient.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ send(const std::string& key, const int value, const std::string& type, const flo
161161
if (isFrequencyOne(frequency))
162162
{
163163
// Sampling rate is 1.0f, no need to specify it
164-
snprintf(buffer, sizeof(buffer), "%s%s:%zd|%s", m_prefix.c_str(), key.c_str(), static_cast<int64_t>(value), type.c_str());
164+
std::snprintf(buffer, sizeof(buffer), "%s%s:%d|%s", m_prefix.c_str(), key.c_str(), value, type.c_str());
165165
}
166166
else
167167
{
168168
// Sampling rate is different from 1.0f, hence specify it
169-
snprintf(buffer, sizeof(buffer), "%s%s:%zd|%s|@%.2f", m_prefix.c_str(), key.c_str(), static_cast<int64_t>(value), type.c_str(), frequency);
169+
std::snprintf(buffer, sizeof(buffer), "%s%s:%d|%s|@%.2f", m_prefix.c_str(), key.c_str(), value, type.c_str(), frequency);
170170
}
171171

172172
// Send the message via the UDP sender

tests/testStatsdClient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ using namespace Statsd;
55

66
int main()
77
{
8-
StatsdClient client{ "localhost", 8080, "myPrefix.", 1 };
8+
StatsdClient client{ "localhost", 8080, "myPrefix.", 20 };
99

1010
// set a new config with a different port
11-
client.setConfig("localhost", 80, "myPrefix.");
11+
client.setConfig("localhost", 8000, "myPrefix.");
1212

1313
// Increment "coco"
1414
client.increment("coco");
@@ -35,4 +35,4 @@ int main()
3535
assert(!client.errorMessage());
3636

3737
return EXIT_SUCCESS;
38-
}
38+
}

0 commit comments

Comments
 (0)