delay_pools.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 /* DEBUG: section 77 Delay Pools */
10 
16 #include "squid.h"
17 
18 #if USE_DELAY_POOLS
19 #include "client_side_request.h"
20 #include "comm/Connection.h"
21 #include "CommonPool.h"
22 #include "CompositePoolNode.h"
23 #include "ConfigParser.h"
24 #include "DelayBucket.h"
25 #include "DelayId.h"
26 #include "DelayPool.h"
27 #include "DelayPools.h"
28 #include "DelaySpec.h"
29 #include "DelayTagged.h"
30 #include "DelayUser.h"
31 #include "DelayVector.h"
32 #include "event.h"
33 #include "http/Stream.h"
34 #include "ip/Address.h"
35 #include "MemObject.h"
36 #include "mgr/Registration.h"
37 #include "NullDelayId.h"
38 #include "sbuf/SBuf.h"
39 #include "Store.h"
40 #include "StoreClient.h"
41 
44 {
46 
47 public:
49  Aggregate();
50  ~Aggregate() override;
51  virtual DelaySpec *rate() {return &spec;}
52 
53  virtual DelaySpec const *rate() const {return &spec;}
54 
55  void stats(StoreEntry * sentry) override;
56  void dump(StoreEntry *entry) const override;
57  void update(int incr) override;
58  void parse() override;
59 
60  DelayIdComposite::Pointer id(CompositeSelectionDetails &) override;
61 
62 private:
63 
66  {
68 
69  public:
71  int bytesWanted (int min, int max) const override;
72  void bytesIn(int qty) override;
73  void delayRead(const AsyncCallPointer &) override;
74 
75  private:
77  };
78 
79  friend class AggregateId;
80 
83 };
84 
86 template <class Key, class Value>
87 class VectorMap
88 {
89 
90 public:
91  VectorMap();
92  unsigned int size() const;
93  unsigned char findKeyIndex (Key const key) const;
94  bool indexUsed (unsigned char const index) const;
95  unsigned int insert (Key const key);
96 
97 #define IND_MAP_SZ 256
98 
101 
102 private:
103  unsigned int nextMapPosition;
104 };
105 
108 {
110 
111 public:
113  void dump(StoreEntry *entry) const override;
114  void parse() override;
115  void update(int incr) override;
116  void stats(StoreEntry * sentry) override;
117 
120  VectorPool();
121  ~VectorPool() override;
122 
123 protected:
124  bool keyAllocated (unsigned char const key) const;
125  virtual DelaySpec *rate() {return &spec;}
126 
127  virtual DelaySpec const *rate() const {return &spec;}
128 
129  virtual char const *label() const = 0;
130 
131  virtual unsigned int makeKey(Ip::Address &src_addr) const = 0;
132 
134 
136  class Id:public DelayIdComposite
137  {
139 
140  public:
141  Id (RefCount<VectorPool>, int);
142  int bytesWanted (int min, int max) const override;
143  void bytesIn(int qty) override;
144 
145  private:
147  int theIndex;
148  };
149 };
150 
153 {
155 
156 protected:
157  char const *label() const override {return "Individual";}
158  unsigned int makeKey(Ip::Address &src_addr) const override;
159 };
160 
162 class ClassCNetPool : public VectorPool
163 {
165 
166 protected:
167  char const *label() const override {return "Network";}
168  unsigned int makeKey (Ip::Address &src_addr) const override;
169 };
170 
171 /* don't use remote storage for these */
174 {
175 
176 public:
177  bool individualUsed (unsigned int index)const;
178  unsigned char findHostMapPosition (unsigned char const host) const;
179  bool individualAllocated (unsigned char host) const;
180  unsigned char hostPosition (DelaySpec &rate, unsigned char const host);
181  void initHostIndex (DelaySpec &rate, unsigned char index, unsigned char host);
182  void update (DelaySpec const &, int incr);
183  void stats(StoreEntry *)const;
184 
187 };
188 
191 {
193 
194 public:
196  void dump(StoreEntry *entry) const override;
197  void parse() override;
198  void update(int incr) override;
199  void stats(StoreEntry * sentry) override;
200 
202  ClassCHostPool();
203  ~ClassCHostPool() override;
204 
205 protected:
206  bool keyAllocated (unsigned char const key) const;
207  virtual DelaySpec *rate() {return &spec;}
208 
209  virtual DelaySpec const *rate() const {return &spec;}
210 
211  virtual char const *label() const {return "Individual";}
212 
213  virtual unsigned int makeKey(Ip::Address &src_addr) const;
214 
215  unsigned char makeHostKey(Ip::Address &src_addr) const;
216 
219 
220  class Id;
221 
222  friend class ClassCHostPool::Id;
223 
225  class Id:public DelayIdComposite
226  {
228 
229  public:
230  Id (RefCount<ClassCHostPool>, unsigned char, unsigned char);
231  int bytesWanted (int min, int max) const override;
232  void bytesIn(int qty) override;
233 
234  private:
236  unsigned char theNet;
237  unsigned char theHost;
238  };
239 };
240 
241 void
243 {
244  theAggregate->delayRead(aRead);
245 }
246 
247 CommonPool *
248 CommonPool::Factory(unsigned char _class, CompositePoolNode::Pointer& compositeCopy)
249 {
250  CommonPool *result = new CommonPool;
251 
252  switch (_class) {
253 
254  case 0:
255  break;
256 
257  case 1:
258  compositeCopy = new Aggregate;
259  result->typeLabel = SBuf("1");
260  break;
261 
262  case 2:
263  result->typeLabel = SBuf("2");
264  {
266  compositeCopy = temp.getRaw();
267  temp->push_back (new Aggregate);
268  temp->push_back(new IndividualPool);
269  }
270  break;
271 
272  case 3:
273  result->typeLabel = SBuf("3");
274  {
276  compositeCopy = temp.getRaw();
277  temp->push_back (new Aggregate);
278  temp->push_back (new ClassCNetPool);
279  temp->push_back (new ClassCHostPool);
280  }
281  break;
282 
283  case 4:
284  result->typeLabel = SBuf("4");
285  {
287  compositeCopy = temp.getRaw();
288  temp->push_back (new Aggregate);
289  temp->push_back (new ClassCNetPool);
290  temp->push_back (new ClassCHostPool);
291 #if USE_AUTH
292  temp->push_back (new DelayUser);
293 #endif
294  }
295  break;
296 
297  case 5:
298  result->typeLabel = SBuf("5");
299  compositeCopy = new DelayTagged;
300  break;
301 
302  default:
303  fatal ("unknown delay pool class");
304  return nullptr;
305  };
306 
307  return result;
308 }
309 
311 {}
312 
313 void
315 {
316  /* If we aren't active, don't try to update us ! */
317  assert (rate.restore_bps != -1);
318 
319  for (unsigned int j = 0; j < individuals.size(); ++j)
320  individuals.values[j].update (rate, incr);
321 }
322 
323 void
325 {
326  for (unsigned int j = 0; j < individuals.size(); ++j) {
327  assert (individualUsed (j));
328  storeAppendPrintf(sentry, " %d:",individuals.key_map[j]);
329  individuals.values[j].stats (sentry);
330  }
331 }
332 
333 unsigned char
334 ClassCBucket::findHostMapPosition (unsigned char const host) const
335 {
336  return individuals.findKeyIndex(host);
337 }
338 
339 bool
340 ClassCBucket::individualUsed (unsigned int index)const
341 {
342  return individuals.indexUsed(index);
343 }
344 
345 bool
346 ClassCBucket::individualAllocated (unsigned char host) const
347 {
348  return individualUsed(findHostMapPosition (host));
349 }
350 
351 unsigned char
352 ClassCBucket::hostPosition (DelaySpec &rate, unsigned char const host)
353 {
354  if (individualAllocated (host))
355  return findHostMapPosition(host);
356 
357  assert (!individualUsed (findHostMapPosition(host)));
358 
359  unsigned char result = findHostMapPosition(host);
360 
361  initHostIndex (rate, result, host);
362 
363  return result;
364 }
365 
366 void
367 ClassCBucket::initHostIndex (DelaySpec &rate, unsigned char index, unsigned char host)
368 {
369  assert (!individualUsed(index));
370 
371  unsigned char const newIndex = individuals.insert (host);
372 
373  /* give the bucket a default value */
374  individuals.values[newIndex].init (rate);
375 }
376 
378 {
379  theBucket.init (*rate());
381 }
382 
384 {
386 }
387 
388 void
390 {
391  rate()->stats (sentry, "Aggregate");
392 
393  if (rate()->restore_bps == -1)
394  return;
395 
396  storeAppendPrintf(sentry, "\t\tCurrent: ");
397 
398  theBucket.stats(sentry);
399 
400  storeAppendPrintf(sentry, "\n\n");
401 }
402 
403 void
405 {
406  rate()->dump (entry);
407 }
408 
409 void
411 {
412  theBucket.update(*rate(), incr);
413  kickReads();
414 }
415 
416 void
418 {
419  rate()->parse();
420 }
421 
424 {
425  if (rate()->restore_bps != -1)
426  return new AggregateId (this);
427  else
428  return new NullDelayId;
429 }
430 
431 Aggregate::AggregateId::AggregateId(RefCount<Aggregate> anAggregate) : theAggregate(anAggregate)
432 {}
433 
434 int
436 {
437  return theAggregate->theBucket.bytesWanted(min, max);
438 }
439 
440 void
442 {
443  theAggregate->theBucket.bytesIn(qty);
444  theAggregate->kickReads();
445 }
446 
448 time_t DelayPools::LastUpdate = 0;
449 unsigned short DelayPools::pools_ (0);
450 
451 void
453 {
454  Mgr::RegisterAction("delay", "Delay Pool Levels", Stats, 0, 1);
455 }
456 
457 void
459 {
460  LastUpdate = getCurrentTime();
461  RegisterWithCacheManager();
462 }
463 
464 void
466 {
467  if (!pools())
468  return;
469 
470  DelayPools::delay_data = new DelayPool[pools()];
471 
472  eventAdd("DelayPools::Update", DelayPools::Update, nullptr, 1.0, 1);
473 }
474 
475 void
477 {
478  delete[] DelayPools::delay_data;
479  pools_ = 0;
480 }
481 
482 void
484 {
485  // To prevent stuck transactions, stop updates only after no new transactions can
486  // register (because the pools were disabled) and the last registered transaction is gone.
487  if (!pools() && toUpdate.empty())
488  return;
489 
490  eventAdd("DelayPools::Update", Update, nullptr, 1.0, 1);
491 
492  int incr = squid_curtime - LastUpdate;
493 
494  if (incr < 1)
495  return;
496 
497  LastUpdate = squid_curtime;
498 
499  std::vector<Updateable *>::iterator pos = toUpdate.begin();
500 
501  while (pos != toUpdate.end()) {
502  (*pos)->update(incr);
503  ++pos;
504  }
505 }
506 
507 void
509 {
510  /* Assume no doubles */
511  toUpdate.push_back(anObject);
512 }
513 
514 void
516 {
517  std::vector<Updateable *>::iterator pos = toUpdate.begin();
518 
519  while (pos != toUpdate.end() && *pos != anObject) {
520  ++pos;
521  }
522 
523  if (pos != toUpdate.end()) {
524  /* move all objects down one */
525  std::vector<Updateable *>::iterator temp = pos;
526  ++pos;
527 
528  while (pos != toUpdate.end()) {
529  *temp = *pos;
530  ++temp;
531  ++pos;
532  }
533 
534  toUpdate.pop_back();
535  }
536 }
537 
538 std::vector<Updateable *> DelayPools::toUpdate;
539 
540 void
542 {
543  storeAppendPrintf(sentry, "Delay pools configured: %d\n\n", DelayPools::pools());
544 
545  for (unsigned short i = 0; i < DelayPools::pools(); ++i) {
546  if (DelayPools::delay_data[i].theComposite().getRaw()) {
547  storeAppendPrintf(sentry, "Pool: %d\n\tClass: " SQUIDSBUFPH "\n\n", i + 1, SQUIDSBUFPRINT(DelayPools::delay_data[i].pool->classTypeLabel()));
549  } else
550  storeAppendPrintf(sentry, "\tMisconfigured pool.\n\n");
551  }
552 }
553 
554 void
556 {
557  if (!DelayPools::pools())
558  return;
559 
560  FreeDelayData();
561 }
562 
563 unsigned short
565 {
566  return pools_;
567 }
568 
569 void
570 DelayPools::pools(unsigned short newPools)
571 {
572  if (pools()) {
573  debugs(3, DBG_CRITICAL, "parse_delay_pool_count: multiple delay_pools lines, aborting all previous delay_pools config");
574  FreePools();
575  }
576 
577  pools_ = newPools;
578 
579  if (pools())
580  InitDelayData();
581 }
582 
583 template <class Key, class Value>
584 VectorMap<Key,Value>::VectorMap() : nextMapPosition(0)
585 {}
586 
587 template <class Key, class Value>
588 unsigned int
590 {
591  return nextMapPosition;
592 }
593 
594 template <class Key, class Value>
595 unsigned int
597 {
598  unsigned char index = findKeyIndex (key);
599  assert (!indexUsed(index));
600 
601  key_map[index] = key;
602 
603  ++nextMapPosition;
604 
605  return index;
606 }
607 
609 {
611 }
612 
614 {
616 }
617 
618 void
620 {
621  rate()->stats (sentry, label());
622 
623  if (rate()->restore_bps == -1) {
624  storeAppendPrintf(sentry, "\n\n");
625  return;
626  }
627 
628  storeAppendPrintf(sentry, "\t\tCurrent:");
629 
630  for (unsigned int i = 0; i < buckets.size(); ++i) {
631  storeAppendPrintf(sentry, " %d:", buckets.key_map[i]);
632  buckets.values[i].stats(sentry);
633  }
634 
635  if (!buckets.size())
636  storeAppendPrintf(sentry, " Not used yet.");
637 
638  storeAppendPrintf(sentry, "\n\n");
639 }
640 
641 void
643 {
644  rate()->dump (entry);
645 }
646 
647 void
649 {
650  if (rate()->restore_bps == -1)
651  return;
652 
653  for (unsigned int i = 0; i< buckets.size(); ++i)
654  buckets.values[i].update (*rate(), incr);
655 }
656 
657 void
659 {
660  rate()->parse();
661 }
662 
663 bool
664 VectorPool::keyAllocated (unsigned char const key) const
665 {
666  return buckets.indexUsed(buckets.findKeyIndex (key));
667 }
668 
669 template <class Key, class Value>
670 bool
671 VectorMap<Key,Value>::indexUsed (unsigned char const index) const
672 {
673  return index < size();
674 }
675 
677 template <class Key, class Value>
678 unsigned char
680 {
681  for (unsigned int index = 0; index < size(); ++index) {
682  assert(indexUsed(index));
683 
684  if (key_map[index] == key)
685  return index;
686  }
687 
688  /* not in map */
689  return size();
690 }
691 
694 {
695  if (rate()->restore_bps == -1)
696  return new NullDelayId;
697 
698  /* non-IPv4 are not able to provide IPv4-bitmask for this pool type key. */
699  if ( !details.src_addr.isIPv4() )
700  return new NullDelayId;
701 
702  unsigned int key = makeKey(details.src_addr);
703 
704  if (keyAllocated(key))
705  return new Id(this, buckets.findKeyIndex(key));
706 
707  unsigned char const resultIndex = buckets.insert(key);
708 
709  buckets.values[resultIndex].init(*rate());
710 
711  return new Id(this, resultIndex);
712 }
713 
714 VectorPool::Id::Id(VectorPool::Pointer aPool, int anIndex) : theVector (aPool), theIndex (anIndex)
715 {}
716 
717 int
719 {
720  return theVector->buckets.values[theIndex].bytesWanted (min, max);
721 }
722 
723 void
725 {
726  theVector->buckets.values[theIndex].bytesIn (qty);
727 }
728 
729 unsigned int
731 {
732  /* IPv4 required for this pool */
733  if ( !src_addr.isIPv4() )
734  return 1;
735 
736  struct in_addr host;
737  src_addr.getInAddr(host);
738  return (ntohl(host.s_addr) & 0xff);
739 }
740 
741 unsigned int
743 {
744  /* IPv4 required for this pool */
745  if ( !src_addr.isIPv4() )
746  return 1;
747 
748  struct in_addr net;
749  src_addr.getInAddr(net);
750  return ( (ntohl(net.s_addr) >> 8) & 0xff);
751 }
752 
754 {
756 }
757 
759 {
761 }
762 
763 void
765 {
766  rate()->stats (sentry, label());
767 
768  if (rate()->restore_bps == -1) {
769  storeAppendPrintf(sentry, "\n\n");
770  return;
771  }
772 
773  for (unsigned int index = 0; index < buckets.size(); ++index) {
774  storeAppendPrintf(sentry, "\t\tCurrent [Network %d]:", buckets.key_map[index]);
775  buckets.values[index].stats (sentry);
776  storeAppendPrintf(sentry, "\n");
777  }
778 
779  if (!buckets.size())
780  storeAppendPrintf(sentry, "\t\tCurrent [All networks]: Not used yet.\n");
781 
782  storeAppendPrintf(sentry, "\n\n");
783 }
784 
785 void
787 {
788  rate()->dump (entry);
789 }
790 
791 void
793 {
794  if (rate()->restore_bps == -1)
795  return;
796 
797  for (unsigned int i = 0; i< buckets.size(); ++i)
798  buckets.values[i].update (*rate(), incr);
799 }
800 
801 void
803 {
804  rate()->parse();
805 }
806 
807 bool
808 ClassCHostPool::keyAllocated (unsigned char const key) const
809 {
810  return buckets.indexUsed(buckets.findKeyIndex (key));
811 }
812 
813 unsigned char
815 {
816  /* IPv4 required for this pool */
817  if ( !src_addr.isIPv4() )
818  return 1;
819 
820  /* Temporary bypass for IPv4-only */
821  struct in_addr host;
822  src_addr.getInAddr(host);
823  return (ntohl(host.s_addr) & 0xff);
824 }
825 
826 unsigned int
828 {
829  /* IPv4 required for this pool */
830  if ( !src_addr.isIPv4() )
831  return 1;
832 
833  struct in_addr net;
834  src_addr.getInAddr(net);
835  return ( (ntohl(net.s_addr) >> 8) & 0xff);
836 }
837 
840 {
841  if (rate()->restore_bps == -1)
842  return new NullDelayId;
843 
844  /* non-IPv4 are not able to provide IPv4-bitmask for this pool type key. */
845  if ( !details.src_addr.isIPv4() )
846  return new NullDelayId;
847 
848  unsigned int key = makeKey (details.src_addr);
849 
850  unsigned char host = makeHostKey (details.src_addr);
851 
852  unsigned char hostIndex;
853 
854  unsigned char netIndex;
855 
856  if (keyAllocated (key))
857  netIndex = buckets.findKeyIndex(key);
858  else
859  netIndex = buckets.insert (key);
860 
861  hostIndex = buckets.values[netIndex].hostPosition (*rate(), host);
862 
863  return new Id (this, netIndex, hostIndex);
864 }
865 
866 ClassCHostPool::Id::Id (ClassCHostPool::Pointer aPool, unsigned char aNet, unsigned char aHost) : theClassCHost (aPool), theNet (aNet), theHost (aHost)
867 {}
868 
869 int
871 {
872  return theClassCHost->buckets.values[theNet].individuals.values[theHost].bytesWanted (min, max);
873 }
874 
875 void
877 {
878  theClassCHost->buckets.values[theNet].individuals.values[theHost].bytesIn (qty);
879 }
880 
881 #endif /* USE_DELAY_POOLS */
882 
virtual DelaySpec * rate()
Definition: delay_pools.cc:207
void fatal(const char *message)
Definition: fatal.cc:28
virtual unsigned int makeKey(Ip::Address &src_addr) const
Definition: delay_pools.cc:827
void bytesIn(int qty) override
Definition: delay_pools.cc:441
friend class AggregateId
Definition: delay_pools.cc:79
MEMPROXY_CLASS(CompositePoolNode)
static void RegisterWithCacheManager(void)
Definition: delay_pools.cc:452
bool keyAllocated(unsigned char const key) const
Definition: delay_pools.cc:808
#define DBG_CRITICAL
Definition: Stream.h:37
void init(DelaySpec const &)
Definition: DelayBucket.cc:47
unsigned char theHost
Definition: delay_pools.cc:237
RefCount< VectorPool > Pointer
Definition: delay_pools.cc:109
RefCount< Aggregate > theAggregate
Definition: delay_pools.cc:76
#define IND_MAP_SZ
Definition: delay_pools.cc:97
void bytesIn(int qty) override
Definition: delay_pools.cc:876
AggregateId(RefCount< Aggregate >)
Definition: delay_pools.cc:431
void update(int incr) override
Definition: delay_pools.cc:792
static std::vector< Updateable * > toUpdate
Definition: DelayPools.h:54
int bytesWanted(int min, int max) const override
Definition: delay_pools.cc:718
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:855
virtual const DelaySpec * rate() const
Definition: delay_pools.cc:209
static void Update(void *)
Definition: delay_pools.cc:483
VectorMap< unsigned char, DelayBucket > individuals
Definition: delay_pools.cc:186
unsigned char findHostMapPosition(unsigned char const host) const
Definition: delay_pools.cc:334
Value values[IND_MAP_SZ]
Definition: delay_pools.cc:100
void dump(StoreEntry *entry) const override
Definition: delay_pools.cc:642
void stats(StoreEntry *sentry) override
Definition: delay_pools.cc:389
Definition: SBuf.h:93
~ClassCHostPool() override
Definition: delay_pools.cc:758
static void deregisterForUpdates(Updateable *)
Definition: delay_pools.cc:515
virtual void stats(StoreEntry *sentry)=0
bool getInAddr(struct in_addr &) const
Definition: Address.cc:1040
const A & max(A const &lhs, A const &rhs)
static CommonPool * Factory(unsigned char _class, CompositePoolNode::Pointer &)
Definition: delay_pools.cc:248
C * getRaw() const
Definition: RefCount.h:89
DelayBucket net
Definition: delay_pools.cc:185
unsigned int nextMapPosition
Definition: delay_pools.cc:103
bool isIPv4() const
Definition: Address.cc:178
void stats(StoreEntry *sentry, char const *) const
Definition: DelaySpec.cc:23
VectorMap< unsigned char, ClassCBucket > buckets
Definition: delay_pools.cc:218
void parse() override
Definition: delay_pools.cc:417
void dump(StoreEntry *entry) const override
Definition: delay_pools.cc:404
void parse()
Definition: DelaySpec.cc:42
unsigned int makeKey(Ip::Address &src_addr) const override
Definition: delay_pools.cc:742
virtual const char * label() const =0
VectorMap< unsigned char, DelayBucket > buckets
Definition: delay_pools.cc:119
int restore_bps
Definition: DelaySpec.h:23
void stats(StoreEntry *) const
Definition: DelayBucket.cc:20
Key key_map[IND_MAP_SZ]
Definition: delay_pools.cc:99
static void FreePools()
Definition: delay_pools.cc:555
void dump(StoreEntry *entry) const override
Definition: delay_pools.cc:786
void dump(StoreEntry *) const
Definition: DelaySpec.cc:36
unsigned char makeHostKey(Ip::Address &src_addr) const
Definition: delay_pools.cc:814
void Stats(StoreEntry *)
Definition: old_api.cc:77
int size
Definition: ModDevPoll.cc:69
unsigned char findKeyIndex(Key const key) const
Definition: delay_pools.cc:679
DelaySpec spec
Definition: delay_pools.cc:217
#define SQUIDSBUFPRINT(s)
Definition: SBuf.h:32
DelayIdComposite::Pointer id(CompositeSelectionDetails &) override
Definition: delay_pools.cc:693
DelayBucket theBucket
Definition: delay_pools.cc:81
DelaySpec spec
Definition: delay_pools.cc:133
void stats(StoreEntry *sentry) override
Definition: delay_pools.cc:619
time_t getCurrentTime() STUB_RETVAL(0) int tvSubUsec(struct timeval
static unsigned short pools_
Definition: DelayPools.h:52
static void Stats(StoreEntry *)
Definition: delay_pools.cc:541
void update(DelaySpec const &, int incr)
Definition: DelayBucket.cc:26
RefCount< ClassCHostPool > Pointer
Definition: delay_pools.cc:192
DelayIdComposite::Pointer id(CompositeSelectionDetails &) override
Definition: delay_pools.cc:839
static void Init()
Definition: delay_pools.cc:458
static void registerForUpdates(Updateable *)
Definition: delay_pools.cc:508
void stats(StoreEntry *sentry) override
Definition: delay_pools.cc:764
DelayIdComposite::Pointer id(CompositeSelectionDetails &) override
Definition: delay_pools.cc:423
DelaySpec spec
Definition: delay_pools.cc:82
void push_back(CompositePoolNode::Pointer)
Definition: DelayVector.cc:80
Id(RefCount< VectorPool >, int)
Definition: delay_pools.cc:714
#define assert(EX)
Definition: assert.h:17
void parse() override
Definition: delay_pools.cc:658
const char * label() const override
Definition: delay_pools.cc:167
~Aggregate() override
Definition: delay_pools.cc:383
time_t squid_curtime
Definition: stub_libtime.cc:20
void delayRead(const AsyncCallPointer &) override
Definition: delay_pools.cc:242
const char * label() const override
Definition: delay_pools.cc:157
static unsigned short pools()
Definition: delay_pools.cc:564
RefCount< VectorPool > theVector
Definition: delay_pools.cc:146
virtual const char * label() const
Definition: delay_pools.cc:211
void initHostIndex(DelaySpec &rate, unsigned char index, unsigned char host)
Definition: delay_pools.cc:367
unsigned int insert(Key const key)
Definition: delay_pools.cc:596
virtual unsigned int makeKey(Ip::Address &src_addr) const =0
virtual const DelaySpec * rate() const
Definition: delay_pools.cc:127
SBuf typeLabel
Definition: CommonPool.h:35
virtual DelaySpec * rate()
Definition: delay_pools.cc:125
int bytesWanted(int min, int max) const override
Definition: delay_pools.cc:435
~VectorPool() override
Definition: delay_pools.cc:613
virtual DelaySpec * rate()
Definition: delay_pools.cc:51
CompositePoolNode::Pointer theComposite()
Definition: DelayPool.h:34
void RegisterAction(char const *action, char const *desc, OBJH *handler, Protected, Atomic, Format)
Definition: Registration.cc:54
static DelayPool * delay_data
Definition: DelayPools.h:46
void stats(StoreEntry *) const
Definition: delay_pools.cc:324
void bytesIn(int qty) override
Definition: delay_pools.cc:724
void delayRead(const AsyncCallPointer &)
Definition: DelayPool.cc:80
static void InitDelayData()
Definition: delay_pools.cc:465
bool individualAllocated(unsigned char host) const
Definition: delay_pools.cc:346
unsigned int makeKey(Ip::Address &src_addr) const override
Definition: delay_pools.cc:730
unsigned char theNet
Definition: delay_pools.cc:236
static time_t LastUpdate
Definition: DelayPools.h:51
bool indexUsed(unsigned char const index) const
Definition: delay_pools.cc:671
unsigned int size() const
Definition: delay_pools.cc:589
void parse() override
Definition: delay_pools.cc:802
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Stream.h:192
const A & min(A const &lhs, A const &rhs)
bool individualUsed(unsigned int index) const
Definition: delay_pools.cc:340
RefCount< Aggregate > Pointer
Definition: delay_pools.cc:45
int bytesWanted(int min, int max) const override
Definition: delay_pools.cc:870
Id(RefCount< ClassCHostPool >, unsigned char, unsigned char)
Definition: delay_pools.cc:866
bool keyAllocated(unsigned char const key) const
Definition: delay_pools.cc:664
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:107
static void FreeDelayData()
Definition: delay_pools.cc:476
#define SQUIDSBUFPH
Definition: SBuf.h:31
void update(int incr) override
Definition: delay_pools.cc:648
void update(int incr) override
Definition: delay_pools.cc:410
virtual const DelaySpec * rate() const
Definition: delay_pools.cc:53
RefCount< ClassCHostPool > theClassCHost
Definition: delay_pools.cc:235
unsigned char hostPosition(DelaySpec &rate, unsigned char const host)
Definition: delay_pools.cc:352
void update(DelaySpec const &, int incr)
Definition: delay_pools.cc:314

 

Introduction

Documentation

Support

Miscellaneous