<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/lib/peek/views, branch docs-patch-77</title>
<subtitle>gitlab.com: gitlab-org/gitlab-ce.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/'/>
<entry>
<title>Fix performance bar thresholds</title>
<updated>2019-09-03T12:13:36+00:00</updated>
<author>
<name>Sean McGivern</name>
<email>sean@gitlab.com</email>
</author>
<published>2019-09-03T12:13:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=18018bcd41c0a08c2a506733241206a0e0a9b7e5'/>
<id>18018bcd41c0a08c2a506733241206a0e0a9b7e5</id>
<content type='text'>
These were written in seconds but are supposed to be in
milliseconds. The total Gitaly time was wrong for the same reason.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These were written in seconds but are supposed to be in
milliseconds. The total Gitaly time was wrong for the same reason.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'fix-peek-on-puma' into 'master'</title>
<updated>2019-09-02T08:43:21+00:00</updated>
<author>
<name>Rémy Coutable</name>
<email>remy@rymai.me</email>
</author>
<published>2019-09-02T08:43:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=b7398bc1fdad6c721cfa35ff17cebc2cb00c8240'/>
<id>b7398bc1fdad6c721cfa35ff17cebc2cb00c8240</id>
<content type='text'>
Fix Peek on Puma

Closes #66528

See merge request gitlab-org/gitlab-ce!32213</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix Peek on Puma

Closes #66528

See merge request gitlab-org/gitlab-ce!32213</pre>
</div>
</content>
</entry>
<entry>
<title>Make performance bar enabled checks consistent</title>
<updated>2019-08-28T16:25:02+00:00</updated>
<author>
<name>Sean McGivern</name>
<email>sean@gitlab.com</email>
</author>
<published>2019-08-27T11:40:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=f9c456bd0c34002952fa4ac812068b38258b108d'/>
<id>f9c456bd0c34002952fa4ac812068b38258b108d</id>
<content type='text'>
Previously, we called the `peek_enabled?` method like so:

    prepend_before_action :set_peek_request_id, if: :peek_enabled?

Now we don't have a `set_peek_request_id` method, so we don't need that
line. However, the `peek_enabled?` part had a side-effect: it would also
populate the request store cache for whether the performance bar was
enabled for the current request or not.

This commit makes that side-effect explicit, and replaces all uses of
`peek_enabled?` with the more explicit
`Gitlab::PerformanceBar.enabled_for_request?`. There is one spec that
still sets `SafeRequestStore[:peek_enabled]` directly, because it is
contrasting behaviour with and without a request store enabled.

The upshot is:

1. We still set the value in one place. We make it more explicit that
   that's what we're doing.
2. Reading that value uses a consistent method so it's easier to find in
   future.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, we called the `peek_enabled?` method like so:

    prepend_before_action :set_peek_request_id, if: :peek_enabled?

Now we don't have a `set_peek_request_id` method, so we don't need that
line. However, the `peek_enabled?` part had a side-effect: it would also
populate the request store cache for whether the performance bar was
enabled for the current request or not.

This commit makes that side-effect explicit, and replaces all uses of
`peek_enabled?` with the more explicit
`Gitlab::PerformanceBar.enabled_for_request?`. There is one spec that
still sets `SafeRequestStore[:peek_enabled]` directly, because it is
contrasting behaviour with and without a request store enabled.

The upshot is:

1. We still set the value in one place. We make it more explicit that
   that's what we're doing.
2. Reading that value uses a consistent method so it's easier to find in
   future.
</pre>
</div>
</content>
</entry>
<entry>
<title>Return warnings for performance bar from backend</title>
<updated>2019-08-28T15:39:33+00:00</updated>
<author>
<name>Sean McGivern</name>
<email>sean@gitlab.com</email>
</author>
<published>2019-08-06T15:04:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=23c1cfcc110b52c1060f35a4a4a7816fb38adc6c'/>
<id>23c1cfcc110b52c1060f35a4a4a7816fb38adc6c</id>
<content type='text'>
For each DetailedView subclass, we add a `warnings` array to:

1. The top-level response.
2. Each individual call under the `details` key.

We use the `.thresholds` hash on the DetailedView to determine what's a
warning. If that hash is empty (the default), then the warnings array
will always be empty.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For each DetailedView subclass, we add a `warnings` array to:

1. The top-level response.
2. Each individual call under the `details` key.

We use the `.thresholds` hash on the DetailedView to determine what's a
warning. If that hash is empty (the default), then the warnings array
will always be empty.
</pre>
</div>
</content>
</entry>
<entry>
<title>Only track Redis calls if Peek is enabled</title>
<updated>2019-08-03T06:48:14+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2019-08-03T06:40:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=a43c84e6ab34056262cc6b831afa01043936b343'/>
<id>a43c84e6ab34056262cc6b831afa01043936b343</id>
<content type='text'>
In dev environments, Sidekiq was encountering the message:

Circular dependency detected while autoloading constant Gitlab::Profiler

This saves some overhead during normal usage.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In dev environments, Sidekiq was encountering the message:

Circular dependency detected while autoloading constant Gitlab::Profiler

This saves some overhead during normal usage.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix SystemStackError when Peek bar is active with Rugged calls</title>
<updated>2019-07-31T22:47:19+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2019-07-31T22:38:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=7a5c4cd0ca692e2fac0d648726b71dcd304602ec'/>
<id>7a5c4cd0ca692e2fac0d648726b71dcd304602ec</id>
<content type='text'>
Peek attempts to serialize results with `to_json`, which calls
`ActiveSupport::JSON`. If an object is passed to `to_json` that contains
instance variables, `ActiveSupport` will attempt to recursively traverse
all variables.

The problem is that we can get into an infinite loop if the instance
references to an instance that references to something else that points
back to the same instance.

To avoid this mess, we just call `to_s` on the object. It appears only
`Gitlab::Git::Repository` and `::Repository` are the culprits here.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65404
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Peek attempts to serialize results with `to_json`, which calls
`ActiveSupport::JSON`. If an object is passed to `to_json` that contains
instance variables, `ActiveSupport` will attempt to recursively traverse
all variables.

The problem is that we can get into an infinite loop if the instance
references to an instance that references to something else that points
back to the same instance.

To avoid this mess, we just call `to_s` on the object. It appears only
`Gitlab::Git::Repository` and `::Repository` are the culprits here.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65404
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove line profiler from performance bar</title>
<updated>2019-07-30T09:00:52+00:00</updated>
<author>
<name>Sean McGivern</name>
<email>sean@gitlab.com</email>
</author>
<published>2019-07-24T11:37:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=18cdc5ba6ce1810c19982475eca89fd385fe31e2'/>
<id>18cdc5ba6ce1810c19982475eca89fd385fe31e2</id>
<content type='text'>
1. The output isn't great. It can be hard to find hotspots and, even
   when you do find them, to find why those are hotspots.
2. It uses some jQuery-specific frontend code which we can remove now
   that we don't have this any more.
3. It's only possible to profile the initial request, not any subsequent
   AJAX requests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. The output isn't great. It can be hard to find hotspots and, even
   when you do find them, to find why those are hotspots.
2. It uses some jQuery-specific frontend code which we can remove now
   that we don't have this any more.
3. It's only possible to profile the initial request, not any subsequent
   AJAX requests.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace peek-pg with our own implementation</title>
<updated>2019-07-26T13:37:26+00:00</updated>
<author>
<name>Sean McGivern</name>
<email>sean@gitlab.com</email>
</author>
<published>2019-07-26T13:03:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=ad1c71663f7780838c7c90979419f3e3cf5ec580'/>
<id>ad1c71663f7780838c7c90979419f3e3cf5ec580</id>
<content type='text'>
This uses an ActiveRecord subscriber to get queries and calculate the
total query time from that. This means that the total will always be
consistent with the queries in the table. It does however mean that we
could potentially miss some queries that don't go through ActiveRecord.

Making this change also allows us to unify the response JSON a little
bit, making the frontend slightly simpler as a result.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This uses an ActiveRecord subscriber to get queries and calculate the
total query time from that. This means that the total will always be
consistent with the queries in the table. It does however mean that we
could potentially miss some queries that don't go through ActiveRecord.

Making this change also allows us to unify the response JSON a little
bit, making the frontend slightly simpler as a result.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use a base class for Peek views</title>
<updated>2019-07-24T15:57:42+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2019-07-24T14:42:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=d7eadcc0f30d3bd005f9dfb160dd0a460b3a8f56'/>
<id>d7eadcc0f30d3bd005f9dfb160dd0a460b3a8f56</id>
<content type='text'>
Introduce a `DetailedView` base class, which is inherited by
the Gitaly, Redis, and Rugged views. This reduces code duplication.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce a `DetailedView` base class, which is inherited by
the Gitaly, Redis, and Rugged views. This reduces code duplication.
</pre>
</div>
</content>
</entry>
<entry>
<title>Hide Rugged data if it doesn't exist</title>
<updated>2019-07-24T05:12:42+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2019-07-24T05:12:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=02a27937255f7815ce8d87ea044d4426848f2841'/>
<id>02a27937255f7815ce8d87ea044d4426848f2841</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
