[squid-dev] [PATCH] convert Delay Pools classes to use MEMPROXY_CLASS

Alex Rousskov rousskov at measurement-factory.com
Thu Feb 2 21:43:21 UTC 2017


On 01/22/2017 02:23 PM, Amos Jeffries wrote:
> On 22/01/2017 4:51 p.m., Alex Rousskov wrote:
>> On 01/21/2017 06:42 PM, Amos Jeffries wrote:
>>> -long DelayPools::MemoryUsed = 0;

>> The total provided by this global was probably quite handy/useful. If we
>> can compute and still print it in DelayPools::Stats(), please do so,
>> probably with a "Delay pools memory used: " prefix.

> With MEMPROXY we dont have access to mem_type to simply sum up the
> memory usage, each pool is also defined within private class scope, and
> the global reporter functionality is hard-coded to be a grid layout.


I was only hoping that the following loop can add up individual pool
memory usage values so that we can report the total after the loop:

>  void
>  DelayPools::Stats(StoreEntry * sentry)
>  {
> -    unsigned short i;
> -
>      storeAppendPrintf(sentry, "Delay pools configured: %d\n\n", DelayPools::pools());
>  
> -    for (i = 0; i < DelayPools::pools(); ++i) {
> +    for (unsigned short i = 0; i < DelayPools::pools(); ++i) {
>          if (DelayPools::delay_data[i].theComposite().getRaw()) {
>              storeAppendPrintf(sentry, "Pool: %d\n\tClass: %s\n\n", i + 1, DelayPools::delay_data[i].pool->theClassTypeLabel());
>              DelayPools::delay_data[i].theComposite()->stats (sentry);
>          } else
>              storeAppendPrintf(sentry, "\tMisconfigured pool.\n\n");
>      }
> -
> -    storeAppendPrintf(sentry, "Memory Used: %d bytes\n", (int) DelayPools::MemoryUsed);
>  }


> I could try to multiple the Foo::UseCount() counters by class sizes, but
> that is a lot of trouble and risks future edits forgetting to update the
> list. I dont think its worthwhile just for this value, but if you insist
> I can try to add that.

No, please do not do anything complicated -- this issue is not worth it.


Thank you,

Alex.



More information about the squid-dev mailing list