Esempio n. 1
0
        /**
         * Use the cosmosClient to "warm it up" before starting a timed performance test.
         */
        private static async Task WarmupClient(string dbname, string cname)
        {
            CosmosAdminUtil util          = new CosmosAdminUtil(cosmosClient, config.IsVerbose());
            List <string>   containerList = await util.ListContainers(dbname);

            Console.WriteLine($"ListContainers - count {containerList.Count}");
            for (int i = 0; i < containerList.Count; i++)
            {
                string name = containerList[i];
                if (name.Equals(cname))
                {
                    Console.WriteLine($"OK: container {cname} is present in db: {dbname}");
                }
            }
        }
Esempio n. 2
0
        private static async Task ListContainers()
        {
            string dbname = cliArgs[1];

            cosmosClient = CosmosClientFactory.RegularClient();
            CosmosAdminUtil util          = new CosmosAdminUtil(cosmosClient, config.IsVerbose());
            List <string>   containerList = await util.ListContainers(dbname);

            Console.WriteLine($"ListContainers - count {containerList.Count}");
            for (int i = 0; i < containerList.Count; i++)
            {
                string cname = containerList[i];
                Console.WriteLine($"container in db: {dbname} -> {cname}");
            }
        }