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

Added support of Oracle #619

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added support of Oracle #619

wants to merge 2 commits into from

Conversation

SebCorbin
Copy link
Contributor

@SebCorbin SebCorbin commented Oct 31, 2022

Now I would like to discuss dropping the uuid on Request mode, is everybody okay with that?

@codecov
Copy link

codecov bot commented Oct 31, 2022

Codecov Report

Merging #619 (834a90c) into master (843c898) will decrease coverage by 0.12%.
The diff coverage is 81.81%.

@@            Coverage Diff             @@
##           master     #619      +/-   ##
==========================================
- Coverage   86.31%   86.18%   -0.13%     
==========================================
  Files          52       53       +1     
  Lines        2090     2114      +24     
==========================================
+ Hits         1804     1822      +18     
- Misses        286      292       +6     
Impacted Files Coverage Δ
silk/model_factory.py 83.82% <ø> (ø)
silk/urls.py 100.00% <ø> (ø)
silk/views/requests.py 98.85% <ø> (ø)
silk/migrations/0009_add_oracle_support.py 63.63% <63.63%> (ø)
silk/models.py 87.12% <100.00%> (-0.17%) ⬇️
silk/request_filters.py 83.12% <100.00%> (+0.10%) ⬆️
silk/views/summary.py 95.45% <100.00%> (+3.51%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines +39 to +50
migrations.RemoveField(
model_name='response',
name='request'
),
migrations.RemoveField(
model_name='sqlquery',
name='request'
),
migrations.RemoveField(
model_name='profile',
name='request'
),
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 valid? I don't see this appearing in silk/models.py.

@@ -0,0 +1,101 @@
# Generated by Django 1.9.7 on 2018-01-10 14:14
Copy link
Member

Choose a reason for hiding this comment

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

This is a very old version of Django. Should this file be regenerated using a supported version of django?

Copy link
Member

Choose a reason for hiding this comment

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

Also, a migration here may require the parent django application to run the migration when upgrading/downgrading django-silk which we should avoid, or if we really need to, should be very clearly messaged in the changelog.

As this migration is currently written, I think upgrading django-silk would require wiping the silk database and downgrading django-silk would not be supported (unless several manual steps are taken to reset the django-silk database which would also involve wiping the database). This PR would need be a breaking change requiring a major version bump.

@@ -58,7 +57,6 @@ def __init__(self, d):


class Request(models.Model):
id = CharField(max_length=36, default=uuid4, primary_key=True)
Copy link
Member

Choose a reason for hiding this comment

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

The default id field for a django model is going to be a BigAutoField which is an integer field. Removing this line would change a Request model from an integer field to a charfield, which would probably break a lot of dependencies or require wiping a lot of data.

@@ -163,7 +164,15 @@ def __str__(self):
return '#queries >= %s' % self.value

def contribute_to_query_set(self, query_set):
return query_set.annotate(num_queries=Count('queries'))
return query_set.annotate(
# This is overly complex due to Oracle not accepting group by on TextField
Copy link
Member

Choose a reason for hiding this comment

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

Is contribute_to_query_set used anywhere in the hot path (for silk to ingest data)? If it is, this change may incur a significant performance degradation to host django apps.

@SebCorbin SebCorbin self-assigned this Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants