Skip to content
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

Event logs for Model #874

Merged
merged 4 commits into from
Apr 2, 2024
Merged

Event logs for Model #874

merged 4 commits into from
Apr 2, 2024

Conversation

ankitk-me
Copy link
Contributor

@ankitk-me ankitk-me commented Mar 21, 2024

fixes: #887

}

@Override
public ConverterHandler supplyReadConverterHandler(
ModelConfig config)
{
return new JsonReadConverterHandler(JsonModelConfig.class.cast(config), supplyCatalog);
return new JsonReadConverterHandler(JsonModelConfig.class.cast(config), context, supplyCatalog);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are passing context, then we no longer need to pass supplyCatalog as it is available via context, agree?

EngineContext context)
{
this.jsonModelTypeId = context.supplyTypeId(JsonModel.NAME);
this.validationFailureEventId = context.supplyEventId("model.json.validation.failure");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Events should be named for past tense as they already happened, so ...validation.failed, not ...validation.failure.

{
enum JsonModelEventType (uint8)
{
VALIDATION_FAILURE (1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Events should be named for past tense as they already happened, so VALIDATION_FAILED, not VALIDATION_FAILURE.

@@ -448,7 +448,8 @@ public void writeEntryStart(
logFile.appendBytes(buffer, index, length);
};
OctetsFW value = key.value();
int converted = convertKey.convert(value.buffer(), value.offset(), value.sizeof(), writeKey);
int converted = convertKey.convert(context.supplyTraceId(), bindingId, value.buffer(), value.offset(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the traceId be passed in via the method call instead?

@@ -526,7 +527,8 @@ public void writeEntryContinue(

if ((flags & FLAGS_FIN) != 0x00 && (entryFlags & CACHE_ENTRY_FLAGS_ABORTED) == 0x00)
{
int converted = convertValue.convert(logFile.buffer(), valueMark.value, valueLength, consumeConverted);
int converted = convertValue.convert(context.supplyTraceId(), bindingId, logFile.buffer(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the traceId be passed in via the method call instead?

@@ -703,7 +707,8 @@ public int writeProduceEntryStart(
logFile.appendBytes(buffer, index, length);
};

converted = convertKey.convert(value.buffer(), value.offset(), value.sizeof(), writeKey);
converted = convertKey.convert(context.supplyTraceId(), bindingId, value.buffer(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the traceId be passed in via the method call instead?

@@ -773,7 +780,8 @@ public int writeProduceEntryContinue(
final int valueLength = valueLimit.value - valueMark.value;
if ((flags & FLAGS_FIN) != 0x00)
{
converted = convertValue.convert(logFile.buffer(), valueMark.value, valueLength, consumeConverted);
converted = convertValue.convert(context.supplyTraceId(), bindingId, logFile.buffer(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the traceId be passed in via the method call instead?

@@ -4967,7 +4967,8 @@ private boolean validContent(
OctetsFW payload)
{
return contentType == null ||
contentType.validate(payload.buffer(), payload.offset(), payload.sizeof(), ValueConsumer.NOP);
contentType.validate(supplyTraceId.getAsLong(), routedId, payload.buffer(), payload.offset(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the traceId be passed in via the method call instead?

@jfallows jfallows merged commit 40d1b6c into aklivity:develop Apr 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support logging of events caused by Model
2 participants