delay_pools.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 "SquidString.h"
39 #include "SquidTime.h"
40 #include "Store.h"
41 #include "StoreClient.h"
42 
45 {
47 
48 public:
50  Aggregate();
51  ~Aggregate();
52  virtual DelaySpec *rate() {return &spec;}
53 
54  virtual DelaySpec const *rate() const {return &spec;}
55 
56  virtual void stats(StoreEntry * sentry);
57  virtual void dump(StoreEntry *entry) const;
58  virtual void update(int incr);
59  virtual void parse();
60 
61  virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &);
62 
63 private:
64 
67  {
69 
70  public:
72  virtual int bytesWanted (int min, int max) const;
73  virtual void bytesIn(int qty);
74  virtual void delayRead(DeferredRead const &);
75 
76  private:
78  };
79 
80  friend class AggregateId;
81 
84 };
85 
87 template <class Key, class Value>
88 class VectorMap
89 {
90 
91 public:
92  VectorMap();
93  unsigned int size() const;
94  unsigned char findKeyIndex (Key const key) const;
95  bool indexUsed (unsigned char const index) const;
96  unsigned int insert (Key const key);
97 
98 #define IND_MAP_SZ 256
99 
102 
103 private:
104  unsigned int nextMapPosition;
105 };
106 
109 {
111 
112 public:
114  virtual void dump(StoreEntry *entry) const;
115  virtual void parse();
116  virtual void update(int incr);
117  virtual void stats(StoreEntry * sentry);
118 
121  VectorPool();
122  ~VectorPool();
123 
124 protected:
125  bool keyAllocated (unsigned char const key) const;
126  virtual DelaySpec *rate() {return &spec;}
127 
128  virtual DelaySpec const *rate() const {return &spec;}
129 
130  virtual char const *label() const = 0;
131 
132  virtual unsigned int makeKey(Ip::Address &src_addr) const = 0;
133 
135 
137  class Id:public DelayIdComposite
138  {
140 
141  public:
142  Id (RefCount<VectorPool>, int);
143  virtual int bytesWanted (int min, int max) const;
144  virtual void bytesIn(int qty);
145 
146  private:
148  int theIndex;
149  };
150 };
151 
154 {
156 
157 protected:
158  virtual char const *label() const {return "Individual";}
159  virtual unsigned int makeKey(Ip::Address &src_addr) const;
160 };
161 
163 class ClassCNetPool : public VectorPool
164 {
166 
167 protected:
168  virtual char const *label() const {return "Network";}
169  virtual unsigned int makeKey (Ip::Address &src_addr) const;
170 };
171 
172 /* don't use remote storage for these */
175 {
176 
177 public:
178  bool individualUsed (unsigned int index)const;
179  unsigned char findHostMapPosition (unsigned char const host) const;
180  bool individualAllocated (unsigned char host) const;
181  unsigned char hostPosition (DelaySpec &rate, unsigned char const host);
182  void initHostIndex (DelaySpec &rate, unsigned char index, unsigned char host);
183  void update (DelaySpec const &, int incr);
184  void stats(StoreEntry *)const;
185 
188 };
189 
192 {
194 
195 public:
197  virtual void dump(StoreEntry *entry) const;
198  virtual void parse();
199  virtual void update(int incr);
200  virtual void stats(StoreEntry * sentry);
201 
203  ClassCHostPool();
204  ~ClassCHostPool();
205 
206 protected:
207  bool keyAllocated (unsigned char const key) const;
208  virtual DelaySpec *rate() {return &spec;}
209 
210  virtual DelaySpec const *rate() const {return &spec;}
211 
212  virtual char const *label() const {return "Individual";}
213 
214  virtual unsigned int makeKey(Ip::Address &src_addr) const;
215 
216  unsigned char makeHostKey(Ip::Address &src_addr) const;
217 
220 
221  class Id;
222 
223  friend class ClassCHostPool::Id;
224 
226  class Id:public DelayIdComposite
227  {
229 
230  public:
231  Id (RefCount<ClassCHostPool>, unsigned char, unsigned char);
232  virtual int bytesWanted (int min, int max) const;
233  virtual void bytesIn(int qty);
234 
235  private:
237  unsigned char theNet;
238  unsigned char theHost;
239  };
240 };
241 
242 void
244 {
245  theAggregate->delayRead(aRead);
246 }
247 
248 CommonPool *
249 CommonPool::Factory(unsigned char _class, CompositePoolNode::Pointer& compositeCopy)
250 {
251  CommonPool *result = new CommonPool;
252 
253  switch (_class) {
254 
255  case 0:
256  break;
257 
258  case 1:
259  compositeCopy = new Aggregate;
260  result->typeLabel = "1";
261  break;
262 
263  case 2:
264  result->typeLabel = "2";
265  {
267  compositeCopy = temp.getRaw();
268  temp->push_back (new Aggregate);
269  temp->push_back(new IndividualPool);
270  }
271  break;
272 
273  case 3:
274  result->typeLabel = "3";
275  {
277  compositeCopy = temp.getRaw();
278  temp->push_back (new Aggregate);
279  temp->push_back (new ClassCNetPool);
280  temp->push_back (new ClassCHostPool);
281  }
282  break;
283 
284  case 4:
285  result->typeLabel = "4";
286  {
288  compositeCopy = temp.getRaw();
289  temp->push_back (new Aggregate);
290  temp->push_back (new ClassCNetPool);
291  temp->push_back (new ClassCHostPool);
292 #if USE_AUTH
293  temp->push_back (new DelayUser);
294 #endif
295  }
296  break;
297 
298  case 5:
299  result->typeLabel = "5";
300  compositeCopy = new DelayTagged;
301  break;
302 
303  default:
304  fatal ("unknown delay pool class");
305  return NULL;
306  };
307 
308  return result;
309 }
310 
312 {}
313 
314 void
316 {
317  /* If we aren't active, don't try to update us ! */
318  assert (rate.restore_bps != -1);
319 
320  for (unsigned int j = 0; j < individuals.size(); ++j)
321  individuals.values[j].update (rate, incr);
322 }
323 
324 void
326 {
327  for (unsigned int j = 0; j < individuals.size(); ++j) {
328  assert (individualUsed (j));
329  storeAppendPrintf(sentry, " %d:",individuals.key_map[j]);
330  individuals.values[j].stats (sentry);
331  }
332 }
333 
334 unsigned char
335 ClassCBucket::findHostMapPosition (unsigned char const host) const
336 {
337  return individuals.findKeyIndex(host);
338 }
339 
340 bool
341 ClassCBucket::individualUsed (unsigned int index)const
342 {
343  return individuals.indexUsed(index);
344 }
345 
346 bool
347 ClassCBucket::individualAllocated (unsigned char host) const
348 {
349  return individualUsed(findHostMapPosition (host));
350 }
351 
352 unsigned char
353 ClassCBucket::hostPosition (DelaySpec &rate, unsigned char const host)
354 {
355  if (individualAllocated (host))
356  return findHostMapPosition(host);
357 
358  assert (!individualUsed (findHostMapPosition(host)));
359 
360  unsigned char result = findHostMapPosition(host);
361 
362  initHostIndex (rate, result, host);
363 
364  return result;
365 }
366 
367 void
368 ClassCBucket::initHostIndex (DelaySpec &rate, unsigned char index, unsigned char host)
369 {
370  assert (!individualUsed(index));
371 
372  unsigned char const newIndex = individuals.insert (host);
373 
374  /* give the bucket a default value */
375  individuals.values[newIndex].init (rate);
376 }
377 
379 {
380  theBucket.init (*rate());
382 }
383 
385 {
387 }
388 
389 void
391 {
392  rate()->stats (sentry, "Aggregate");
393 
394  if (rate()->restore_bps == -1)
395  return;
396 
397  storeAppendPrintf(sentry, "\t\tCurrent: ");
398 
399  theBucket.stats(sentry);
400 
401  storeAppendPrintf(sentry, "\n\n");
402 }
403 
404 void
406 {
407  rate()->dump (entry);
408 }
409 
410 void
412 {
413  theBucket.update(*rate(), incr);
414  kickReads();
415 }
416 
417 void
419 {
420  rate()->parse();
421 }
422 
425 {
426  if (rate()->restore_bps != -1)
427  return new AggregateId (this);
428  else
429  return new NullDelayId;
430 }
431 
432 Aggregate::AggregateId::AggregateId(RefCount<Aggregate> anAggregate) : theAggregate(anAggregate)
433 {}
434 
435 int
437 {
438  return theAggregate->theBucket.bytesWanted(min, max);
439 }
440 
441 void
443 {
444  theAggregate->theBucket.bytesIn(qty);
445  theAggregate->kickReads();
446 }
447 
448 DelayPool *DelayPools::delay_data = NULL;
449 time_t DelayPools::LastUpdate = 0;
450 unsigned short DelayPools::pools_ (0);
451 
452 void
454 {
455  Mgr::RegisterAction("delay", "Delay Pool Levels", Stats, 0, 1);
456 }
457 
458 void
460 {
461  LastUpdate = getCurrentTime();
462  RegisterWithCacheManager();
463 }
464 
465 void
467 {
468  if (!pools())
469  return;
470 
471  DelayPools::delay_data = new DelayPool[pools()];
472 
473  eventAdd("DelayPools::Update", DelayPools::Update, NULL, 1.0, 1);
474 }
475 
476 void
478 {
480  delete[] DelayPools::delay_data;
481  pools_ = 0;
482 }
483 
484 void
485 DelayPools::Update(void *unused)
486 {
487  if (!pools())
488  return;
489 
490  eventAdd("DelayPools::Update", Update, NULL, 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: %s\n\n", i + 1, DelayPools::delay_data[i].pool->theClassTypeLabel());
548  DelayPools::delay_data[i].theComposite()->stats (sentry);
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 
RefCount< VectorPool > theVector
Definition: delay_pools.cc:147
void update(DelaySpec const &, int incr)
Definition: DelayBucket.cc:26
#define assert(EX)
Definition: assert.h:17
virtual void update(int incr)
Definition: delay_pools.cc:411
void push_back(CompositePoolNode::Pointer)
Definition: DelayVector.cc:79
void Stats(StoreEntry *)
Definition: old_api.cc:171
friend class AggregateId
Definition: delay_pools.cc:80
DelayBucket net
Definition: delay_pools.cc:186
virtual void bytesIn(int qty)
Definition: delay_pools.cc:724
static void deregisterForUpdates(Updateable *)
Definition: delay_pools.cc:515
virtual void stats(StoreEntry *sentry)
Definition: delay_pools.cc:764
static unsigned short pools()
Definition: delay_pools.cc:564
virtual void parse()
Definition: delay_pools.cc:802
Id(RefCount< VectorPool >, int)
Definition: delay_pools.cc:714
int i
Definition: membanger.c:49
virtual unsigned int makeKey(Ip::Address &src_addr) const
Definition: delay_pools.cc:742
bool individualAllocated(unsigned char host) const
Definition: delay_pools.cc:347
virtual unsigned int makeKey(Ip::Address &src_addr) const =0
static std::vector< Updateable * > toUpdate
Definition: DelayPools.h:54
virtual void delayRead(DeferredRead const &)
Definition: delay_pools.cc:243
DelayBucket theBucket
Definition: delay_pools.cc:82
MEMPROXY_CLASS(Aggregate::AggregateId)
virtual unsigned int makeKey(Ip::Address &src_addr) const
Definition: delay_pools.cc:730
RefCount< Aggregate > theAggregate
Definition: delay_pools.cc:77
#define DBG_CRITICAL
Definition: Debug.h:44
virtual DelaySpec const * rate() const
Definition: delay_pools.cc:210
void parse()
Definition: DelaySpec.cc:42
virtual void dump(StoreEntry *entry) const
Definition: delay_pools.cc:642
MEMPROXY_CLASS(IndividualPool)
static DelayPool * delay_data
Definition: DelayPools.h:46
AggregateId(RefCount< Aggregate >)
Definition: delay_pools.cc:432
A const & max(A const &lhs, A const &rhs)
time_t squid_curtime
Definition: stub_time.cc:17
static CommonPool * Factory(unsigned char _class, CompositePoolNode::Pointer &)
Definition: delay_pools.cc:249
MEMPROXY_CLASS(ClassCNetPool)
virtual char const * label() const
Definition: delay_pools.cc:212
virtual void stats(StoreEntry *sentry)
Definition: delay_pools.cc:390
void delayRead(DeferredRead const &)
Definition: DelayPool.cc:80
Id(RefCount< ClassCHostPool >, unsigned char, unsigned char)
Definition: delay_pools.cc:866
virtual void parse()
Definition: delay_pools.cc:658
virtual void dump(StoreEntry *entry) const
Definition: delay_pools.cc:786
virtual DelaySpec const * rate() const
Definition: delay_pools.cc:128
RefCount< VectorPool > Pointer
Definition: delay_pools.cc:113
virtual int bytesWanted(int min, int max) const
Definition: delay_pools.cc:718
unsigned char hostPosition(DelaySpec &rate, unsigned char const host)
Definition: delay_pools.cc:353
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:123
static void Init()
Definition: delay_pools.cc:459
int restore_bps
Definition: DelaySpec.h:23
MEMPROXY_CLASS(ClassCHostPool)
void RegisterAction(char const *action, char const *desc, OBJH *handler, int pw_req_flag, int atomic)
Definition: Registration.cc:16
unsigned int nextMapPosition
Definition: delay_pools.cc:104
virtual DelaySpec * rate()
Definition: delay_pools.cc:126
void stats(StoreEntry *sentry, char const *) const
Definition: DelaySpec.cc:23
unsigned char findHostMapPosition(unsigned char const host) const
Definition: delay_pools.cc:335
unsigned char makeHostKey(Ip::Address &src_addr) const
Definition: delay_pools.cc:814
MEMPROXY_CLASS(ClassCHostPool::Id)
VectorMap< unsigned char, DelayBucket > buckets
Definition: delay_pools.cc:120
MEMPROXY_CLASS(VectorPool::Id)
Key key_map[IND_MAP_SZ]
Definition: delay_pools.cc:100
MEMPROXY_CLASS(VectorPool)
virtual DelaySpec * rate()
Definition: delay_pools.cc:208
void fatal(const char *message)
Definition: fatal.cc:39
DelaySpec spec
Definition: delay_pools.cc:134
void init(DelaySpec const &)
Definition: DelayBucket.cc:47
static void RegisterWithCacheManager(void)
Definition: delay_pools.cc:453
void update(DelaySpec const &, int incr)
Definition: delay_pools.cc:315
unsigned char findKeyIndex(Key const key) const
Definition: delay_pools.cc:679
virtual void parse()
Definition: delay_pools.cc:418
virtual void update(int incr)
Definition: delay_pools.cc:648
VectorMap< unsigned char, DelayBucket > individuals
Definition: delay_pools.cc:187
bool isIPv4() const
Definition: Address.cc:151
RefCount< ClassCHostPool > theClassCHost
Definition: delay_pools.cc:236
static void InitDelayData()
Definition: delay_pools.cc:466
void stats(StoreEntry *) const
Definition: DelayBucket.cc:20
String typeLabel
Definition: CommonPool.h:35
void initHostIndex(DelaySpec &rate, unsigned char index, unsigned char host)
Definition: delay_pools.cc:368
virtual int bytesWanted(int min, int max) const
Definition: delay_pools.cc:436
void dump(StoreEntry *) const
Definition: DelaySpec.cc:36
void eventDelete(EVH *func, void *arg)
Definition: event.cc:131
#define IND_MAP_SZ
Definition: delay_pools.cc:98
virtual char const * label() const =0
Value values[IND_MAP_SZ]
Definition: delay_pools.cc:101
virtual char const * label() const
Definition: delay_pools.cc:158
unsigned char theNet
Definition: delay_pools.cc:237
virtual DelaySpec const * rate() const
Definition: delay_pools.cc:54
CompositePoolNode::Pointer theComposite()
Definition: DelayPool.h:34
unsigned int insert(Key const key)
Definition: delay_pools.cc:596
time_t getCurrentTime(void)
Get current time.
virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &)
Definition: delay_pools.cc:839
static void FreeDelayData()
Definition: delay_pools.cc:477
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:109
virtual void stats(StoreEntry *sentry)=0
virtual int bytesWanted(int min, int max) const
Definition: delay_pools.cc:870
bool indexUsed(unsigned char const index) const
Definition: delay_pools.cc:671
RefCount< ClassCHostPool > Pointer
Definition: delay_pools.cc:196
VectorMap< unsigned char, ClassCBucket > buckets
Definition: delay_pools.cc:219
bool individualUsed(unsigned int index) const
Definition: delay_pools.cc:341
virtual void update(int incr)
Definition: delay_pools.cc:792
void stats(StoreEntry *) const
Definition: delay_pools.cc:325
static void Stats(StoreEntry *)
Definition: delay_pools.cc:541
DelaySpec spec
Definition: delay_pools.cc:218
virtual void dump(StoreEntry *entry) const
Definition: delay_pools.cc:405
unsigned int size() const
Definition: delay_pools.cc:589
void const cache_key * key
virtual void bytesIn(int qty)
Definition: delay_pools.cc:876
virtual unsigned int makeKey(Ip::Address &src_addr) const
Definition: delay_pools.cc:827
virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &)
Definition: delay_pools.cc:424
RefCount< Aggregate > Pointer
Definition: delay_pools.cc:49
static time_t LastUpdate
Definition: DelayPools.h:51
bool keyAllocated(unsigned char const key) const
Definition: delay_pools.cc:664
static void FreePools()
Definition: delay_pools.cc:555
virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &)
Definition: delay_pools.cc:693
bool getInAddr(struct in_addr &) const
Definition: Address.cc:1038
virtual void bytesIn(int qty)
Definition: delay_pools.cc:442
virtual void stats(StoreEntry *sentry)
Definition: delay_pools.cc:619
static void Update(void *)
Definition: delay_pools.cc:485
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:904
C * getRaw() const
Definition: RefCount.h:74
DelaySpec spec
Definition: delay_pools.cc:83
static unsigned short pools_
Definition: DelayPools.h:52
virtual DelaySpec * rate()
Definition: delay_pools.cc:52
#define NULL
Definition: types.h:166
unsigned char theHost
Definition: delay_pools.cc:238
int size
Definition: ModDevPoll.cc:77
A const & min(A const &lhs, A const &rhs)
bool keyAllocated(unsigned char const key) const
Definition: delay_pools.cc:808
static void registerForUpdates(Updateable *)
Definition: delay_pools.cc:508
MEMPROXY_CLASS(Aggregate)
virtual char const * label() const
Definition: delay_pools.cc:168

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors