Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Minor perf and logging support changes #256

Closed
wants to merge 3 commits into from
Closed

Conversation

lodejard
Copy link
Contributor

Uses header properties directly in a few places

Provides a value for Response.Stream.Length in support of that logging the response content size

throw new NotImplementedException();
}
}
public override long Length => Position;
Copy link
Member

Choose a reason for hiding this comment

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

Length is only expected to be available for seekable streams. https://msdn.microsoft.com/en-us/library/system.io.stream.length(v=vs.110).aspx NotSupportedException: A class derived from Stream does not support seeking. Position has the same expectation. https://msdn.microsoft.com/en-us/library/system.io.stream.position(v=vs.110).aspx

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we just add a new property to FrameResponseStream. BytesWritten perhaps? This way we can throw from Length and Position as expected.

@lodejard where were you planning on logging the this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From hosting, corresponding to "bytes written" you see in server logs.

Copy link
Member

Choose a reason for hiding this comment

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

Is this logging meant to be server agnostic? Would using Stream.Length work for WebListener?

Copy link
Member

Choose a reason for hiding this comment

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

No it won't, and it won't work for Nowin either. aspnet/Hosting#403 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both of those could easily be updated. But the idea you suggested of having a request statistics feature should also be considered.

@lodejard lodejard force-pushed the lodejard/perf-logging branch from 348604f to a39529d Compare October 16, 2015 20:09
{
SocketOutput.Write(_continueBytes);
foreach(var expect in _requestHeaders.HeaderExpect)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: format here?

Copy link
Contributor

Choose a reason for hiding this comment

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

space after foreach

@halter73
Copy link
Member

halter73 commented Nov 4, 2015

@lodejard do you still want to merge this?

@halter73
Copy link
Member

halter73 commented Dec 1, 2015

I think this is too stale to remain open.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants