I don’t think there’s a way to figure out when a given key was written. If you really needed that, you could write it as part of the data you stored, or use the ‘flags’ field to store a unixtime timestamp.
You can get the age of the oldest key, on a per-slab basis, with ‘stats items’ and looking at the ‘age’ field. If you want the overall oldest age, you’ll have to find the oldest age value amongst all the slabs. Do note, though, that if you have evictions going on, ‘oldest’ is kind of dubious, if you’re trying to use it as a “anything newer than this exists”, since evictions happen in lru order and per-slab, so younger items can disappear before older ones, if they’re in a different slab or have been accessed more recently. (Don’t know if that’s what you’re doing, but just in case you are…) -j On Mon, Jan 12, 2015 at 9:34 AM, Gurdipe Dosanjh <[email protected]> wrote: > Hi All, > > I am new to memcache and need to know is there a where to work out when > the key was written to memcache and calculate the age of the oldest key on > our memcache? > > Kind Regards > > Gurdipe > > -- > > --- > You received this message because you are subscribed to the Google Groups > "memcached" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "memcached" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
