Created
August 15, 2019 06:54
-
-
Save raupachz/3720121bc166562f7f010f27900afbdf to your computer and use it in GitHub Desktop.
Code for my Medium article AWS Lambda for Java Developers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.amazonaws.services.lambda.runtime.Context; | |
import com.amazonaws.services.lambda.runtime.RequestHandler; | |
public class LambdaFunction implements RequestHandler<Void, String> { | |
private final long classloaderTime = System.currentTimeMillis(); | |
private final long constructorTime; | |
private long methodTime; | |
public LambdaFunction() { | |
constructorTime = System.currentTimeMillis(); | |
} | |
public String handleRequest(Void args, Context context) { | |
methodTime = System.currentTimeMillis(); | |
return new StringBuilder() | |
.append("classloaderTime=") | |
.append(classloaderTime) | |
.append(", constructorTime=") | |
.append(constructorTime) | |
.append(", methodTime=") | |
.append(methodTime) | |
.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment