- From: Ilya Grigorik <igrigorik@google.com>
- Date: Wed, 4 Mar 2015 11:36:55 -0800
- To: Todd Reifsteck <toddreif@microsoft.com>
- Cc: Nic Jansma <nic@nicj.net>, "public-web-perf@w3.org" <public-web-perf@w3.org>
- Message-ID: <CADXXVKog8zUyXx9Y=+vjatbZVd8Wpz5otVXiCckAiP847euTZw@mail.gmail.com>
Yep, this smells like another instance of same problem described here: https://lists.w3.org/Archives/Public/public-web-perf/2015Feb/0062.html On Wed, Mar 4, 2015 at 8:46 AM, Todd Reifsteck <toddreif@microsoft.com> wrote: > Ilya previously suggested a resourceId uses to associate resource > timings for identifying relationships such as preflight->xhr. I generally > agree that it could be re-used on ServerTiming for association. > > > > What are other folk’s thoughts? > > > > -Todd > > > > *From:* Nic Jansma [mailto:nic@nicj.net] > *Sent:* Wednesday, March 4, 2015 7:52 AM > *To:* public-web-perf@w3.org > *Subject:* [server-timing] Linking to a ResourceTiming entry > > > > Hi everyone, > > From my understanding of ServerTiming, you'll get an entry in the > PerformanceTimeline with these attributes: > > name (URL of resource) > > entryType, startTime, duration (common PerformanceTimline attributes) > > metric > > description > > The example shows how you can get the ServerTiming (and ResourceTiming) > for a particular resource: > > var serverMetrics = window.performance.getEntriesByName('https://example.com/resource.jpg'); > > for (i = 0; i < serverMetrics.length; i++) < > > /span>{ > > entry = serverMetrics[i]; > > if (entry == "server") { > > // entry.metric, entry.duration, entry.description > > } > > } > > But what if the same resource is downloaded twice for some reason? For > example, if there are non-cachable headers on an XHR. How can you be sure > which ServerTIming goes with which ResourceTiming? > > Is the startTime guaranteed to be the same for the ServerTiming and > ResourceTiming entries? That would be one way to "link" them. > > If not, should we add an additional attribute to link the two in some > way? A "resourceId" that is the same on both ServerTiming and > ResourceTiming entries? > > It's a bit of an edge case, but something that would be helpful to think > through now. > > -- > > - Nic > >
Received on Wednesday, 4 March 2015 19:38:08 UTC