mirror of https://github.com/Icinga/icinga2.git
Minor performance tweaks.
This commit is contained in:
parent
1375c64ad9
commit
2e051ad9e2
|
@ -127,9 +127,11 @@ void DelegationComponent::DelegationTimerHandler(void)
|
|||
std::vector<Endpoint::Ptr>::iterator cit;
|
||||
|
||||
if (!candidates.empty()) {
|
||||
#ifdef _DEBUG
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "Service: " << service->GetName() << ", candidates: " << candidates.size();
|
||||
Log(LogDebug, "delegation", msgbuf.str());
|
||||
#endif /* _DEBUG */
|
||||
|
||||
BOOST_FOREACH(const Endpoint::Ptr& candidate, candidates) {
|
||||
avg_services += histogram[candidate];
|
||||
|
|
|
@ -155,17 +155,17 @@ ProcessResult Process::Run(void)
|
|||
(void) close(fds[1]);
|
||||
|
||||
char buffer[512];
|
||||
int rc;
|
||||
|
||||
std::ostringstream outputStream;
|
||||
|
||||
do {
|
||||
rc = read(fd, buffer, sizeof(buffer));
|
||||
for (;;) {
|
||||
int rc = read(fd, buffer, sizeof(buffer));
|
||||
|
||||
if (rc > 0) {
|
||||
outputStream.write(buffer, rc);
|
||||
}
|
||||
} while (rc > 0);
|
||||
if (rc <= 0)
|
||||
break;
|
||||
|
||||
outputStream.write(buffer, rc);
|
||||
}
|
||||
|
||||
String output = outputStream.str();
|
||||
|
||||
|
|
Loading…
Reference in New Issue