public async Task ResizeToRecommendedAsync(LambdaSizeCalculationResult result, string regionName, string functionName)
        {
            if (result.OriginalMemory != result.Recommended.MemoryAllocated)
            {
                var conProvider = new LambdaConnectionProvider();
                var client      = conProvider.GetLambdaClient(regionName);
                var resizer     = new LambdaResizer(client);
                await resizer.Resize(functionName, result.Recommended.MemoryAllocated);

                Console.WriteLine("successfully resized.");
            }
        }
Exemplo n.º 2
0
        public static void PrintResult(LambdaSizeCalculationResult result)
        {
            Console.WriteLine("All results:");
            Console.WriteLine("Memory Allocated\tLatency\tMemory Used");

            foreach (var resultItem in result.Items)
            {
                Console.WriteLine($"{resultItem.MemoryAllocated} MB          \t{resultItem.Latency} ms\t{resultItem.MemoryUsed}");
            }

            if (result.OriginalMemory != result.Recommended.MemoryAllocated)
            {
                Console.WriteLine($"Recommended result: Resize Lambda to {result.Recommended.MemoryAllocated} MB, it had latency of {result.Recommended.Latency} ms.");
            }
            else
            {
                Console.WriteLine($"Your Lambda is already appropriately sized, memory size is at {result.Recommended.MemoryAllocated} MB, it had latency of {result.Recommended.Latency} ms.");
            }
        }