Update SQL, REST, and redis subclasses to emit call count and payload size metrics for cache key operations. These metrics are bucketed by cache key collection (similar to WANCache). Bug: T235705 Change-Id: Icaa3fa1ae9c8b0f664c26ce70b7e1c4fc5f92767
33 lines
1.3 KiB
PHP
33 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Generic interface for object stores with key encoding methods.
|
|
*
|
|
* @ingroup Cache
|
|
* @since 1.34
|
|
*/
|
|
interface IStoreKeyEncoder {
|
|
/**
|
|
* Make a cache key using the "global" keyspace for the given components
|
|
*
|
|
* Encoding is limited to the escaping of delimiter (":") and escape ("%") characters.
|
|
* Any backend-specific encoding should be delegated to methods that use the network.
|
|
*
|
|
* @param string $collection Key collection name component
|
|
* @param string|int ...$components Additional, ordered, key components for entity IDs
|
|
* @return string Colon-separated, keyspace-prepended, ordered list of encoded components
|
|
*/
|
|
public function makeGlobalKey( $collection, ...$components );
|
|
|
|
/**
|
|
* Make a cache key using the default keyspace for the given components
|
|
*
|
|
* Encoding is limited to the escaping of delimiter (":") and escape ("%") characters.
|
|
* Any backend-specific encoding should be delegated to methods that use the network.
|
|
*
|
|
* @param string $collection Key collection name component
|
|
* @param string|int ...$components Additional, ordered, key components for entity IDs
|
|
* @return string Colon-separated, keyspace-prepended, ordered list of encoded components
|
|
*/
|
|
public function makeKey( $collection, ...$components );
|
|
}
|