- Product pad(1, 5.0);
- const string key("padraig");
- cout << "Going to set an object in the cache..." << endl;
- setProduct(key, pad);
- cout << "Now retrieve that key..." << endl;
- Product test= getProduct(key);
- double price= test.getPrice();
- cout << "Price of retrieve object: " << price << endl;
- Product next(2, 10.0);
- vector<Product> products;
- products.push_back(pad);
- products.push_back(next);
- cout << "going to set a vector of products..." << endl;
- setAllProducts(products);
- cout << "now retrieve those products..." << endl;
- vector<Product> got= getAllProducts();
- cout << "size of retrieved vector: " << got.size() << endl;
- vector<Product>::iterator iter= got.begin();
- while (iter != got.end())
+ Memcache first_client("127.0.0.1:19191");
+ map< string, map<string, string> > my_stats;
+ first_client.getStats(my_stats);
+
+ /*
+ * Iterate through the retrieved stats.
+ */
+ map< string, map<string, string> >::iterator it=
+ my_stats.begin();
+ while (it != my_stats.end())