[squid-dev] [PATCH] PackableStream for cachemgr reports

Kinkie gkinkie at gmail.com
Thu Aug 6 07:43:32 UTC 2015


I like this.

On Wed, Aug 5, 2015 at 6:24 PM, Amos Jeffries <squid3 at treenet.co.nz> wrote:

> Adds a PackableStream class which provides std::ostream semantics for
> writing data to a cachemgr report.
>
> FYI: This follows on from discussiosn back in 2011 regarding how to
> restructure the cachemgr internal data storage for relay between workers
> vs the report output formatting.
>
> Current trunk 'improved' code uses FooActionData classes to store and
> relay the report data internally, and classes implementing the Action
> API to format the report for delivery.
>
>
> For easy transition I have added an overload dump() method to the Action
> class API. New FooAction child classes should override the
> dump(ostream&) method instead of the StoreEntry one. Writing their data
> to the stream.
>
> Older actions overload the now-deprecated dump(StoreEntry*) method and
> use some complicate nested function calls or share helper functions in
> complex ways which make it hard to upgrade all at once. So for now the
> dump(StoreEntry*) is made a stub that calls dump(ostream&) if not
> overridden explicitly.
>
> The CacheManager class still uses dump(StoreEntry*) to get the reply
> payload from Action childs regardless of which dumper they implement.
>
> The basic report types are converted as part of this to be the first
> Actions using the stream output. The menu action in particular is
> slightly polished to benefit from stream abilities.
>
>
> Future steps along this path (in no particular order) are:
> * convert old Action classes to new API
> * refactor old C-code report generators to be Action classes
>  - fixing display output syntax to minimal YAML as we go on both the
> above. It mostly is already, but some reports have wrong syntax.
> * update Actions to be hidden from the menu display
> * update Actions to support menu name aliases
> * update Action API to receive client desired format
>
> Amos
>
>
> _______________________________________________
> squid-dev mailing list
> squid-dev at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-dev
>
>


-- 
    Francesco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150806/1c357ebd/attachment.html>


More information about the squid-dev mailing list