-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closes #214: Log execution time of all CRUD APIs #216
Conversation
logger.log( | ||
""" | ||
${api.redactedCopyOrThis(logger.redactMessages)} | ||
execution time: $executionTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWESOME!!!
internal fun onPostExecute(result: CrudApi.Result) { | ||
listeners.forEach { it.onPostExecute(result) } | ||
internal fun onPostExecute(api: CrudApi, result: CrudApi.Result) { | ||
listeners.forEach { it.onPostExecute(api, result) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
internal fun CrudApi.Result.onPostExecute(contactsApi: Contacts) { | ||
contactsApi.apiListenerRegistry.onPostExecute(this) | ||
internal fun CrudApi.onPostExecute(contactsApi: Contacts, result: CrudApi.Result) { | ||
contactsApi.apiListenerRegistry.onPostExecute(this, result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THANK YOU FOR THIS AWESOME CONTRIBUTION!!!!
logRedactable(result) | ||
} | ||
override fun onPostExecute(api: CrudApi, result: CrudApi.Result) { | ||
val executionTime = apiExecutionStartTimeMillis.remove(api) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm an idiot for missing this lol. This is supposed to be something like;
val executionTime = System.currentTimeMillis() - apiExecutionStartTimeMillis.remove(api)
I'll fix it in main directly =)
Log execution timer implementation to address issue #214