22 service(serviceId), start(when), theRptm(-1), retried(false)
54 if (retrying && !theEntries.empty())
55 theEntries.back().retried =
true;
58 return theEntries.
size() - 1;
63 Must(0 <= hid && hid <
static_cast<int>(theEntries.size()));
64 theEntries[hid].stop();
70 bool prevWasRetried =
false;
71 for (
auto &i : theEntries) {
73 if (!serviceId || i.service == serviceId) {
75 s.
append(prevWasRetried ?
'+' :
',');
79 prevWasRetried = i.retried;
87 for (
auto & i : theEntries) {
89 retriedRptm += i.rptm();
90 }
else if (!serviceId || i.service == serviceId) {
93 s.
appendf(
"%d", retriedRptm + i.rptm());
113 if (theXxName.size() <= 0)
124 debugs(93,3,
"old services: " << theNextServices);
125 debugs(93,3,
"new services: " << services);
127 theNextServices = services;
135 value = theNextServices;
152 theAdaptationServices.push_back(srvId);
158 if (!theFutureServices.empty())
159 debugs(93,3,
"old future services: " << theFutureServices);
160 debugs(93,3,
"new future services: " << services);
161 theFutureServices = services;
169 theFutureServices = future;
static const char * TheNullServices
impossible services value to identify unset theNextServices
DynamicServiceGroup configuration to remember future dynamic chains.
static void Split(const ServiceFilter &filter, const String &ids, DynamicGroupCfg ¤t, DynamicGroupCfg &future)
separates dynamic services matching current location from future ones
single Xaction stats (i.e., a historical record entry)
void stop()
updates stats on transaction end
int rptm()
returns response time [msec], calculates it if needed
void sumLogString(const char *serviceId, SBuf &)
dump xaction times, merging retried and retry times together
bool extractNextServices(String &value)
returns true, fills the value, and resets iff next services were set
String theNextServices
services Adaptation::Iterator must use next
DynamicGroupCfg extractCurrentServices(const ServiceFilter &)
returns and forgets planned/future services matching the given filter
int recordXactStart(const String &serviceId, const timeval &when, bool retrying)
record the start of a xact, return xact history ID
void updateXxRecord(const char *name, const String &value)
sets or resets a cross-transactional database record
void setFutureServices(const DynamicGroupCfg &services)
sets future services for the Adaptation::AccessCheck to notice
HttpHeader allMeta
All REQMOD and RESPMOD meta headers merged. Last field wins conflicts.
bool getXxRecord(String &name, String &value) const
returns true and fills the record fields iff there is a db record
void updateNextServices(const String &services)
sets or resets next services for the Adaptation::Iterator to notice
void recordAdaptationService(SBuf &srvId)
void recordMeta(const HttpHeader *lm)
store the last meta header fields received from the adaptation service
HttpHeader lastMeta
Last received meta header (REQMOD or RESPMOD, whichever comes last).
void allLogString(const char *serviceId, SBuf &)
dump individual xaction times to a string
void recordXactFinish(int hid)
record the end of a xact identified by its history ID
information used to search for adaptation services
SBuf & appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
SBuf & append(const SBuf &S)
#define debugs(SECTION, LEVEL, CONTENT)
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format
int tvSubMsec(struct timeval t1, struct timeval t2)