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

Adds content-app to status API #183

Merged
merged 1 commit into from Jun 24, 2019

Conversation

bmbouter
Copy link
Member

@bmbouter bmbouter commented Jun 22, 2019

A new model is introduced called ContentAppStatus is introduced which
will record status check-in records from the Content App.

The Content App will check in periodically checkin and write to the
ContentAppStatus object.

To tell the ContentAppStatus records apart for multiple Content Apps
each Content App now requires a name. The name is auto-selected as
'{pid}@{hostname}'.

The Status API viewset now shows a 'content_apps' section which lists
the ContentAppStatus records, showing their names and last heartbeat
time.

Adds a doc and feature changelog entries.

https://pulp.plan.io/issues/4881
closes #4881

@codecov
Copy link

codecov bot commented Jun 22, 2019

Codecov Report

Merging #183 into master will increase coverage by 0.21%.
The diff coverage is 83.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #183      +/-   ##
==========================================
+ Coverage   67.31%   67.53%   +0.21%     
==========================================
  Files          65       66       +1     
  Lines        3087     3123      +36     
==========================================
+ Hits         2078     2109      +31     
- Misses       1009     1014       +5
Impacted Files Coverage Δ
pulpcore/app/serializers/task.py 100% <100%> (+1.75%) ⬆️
pulpcore/app/settings.py 97.91% <100%> (+0.04%) ⬆️
pulpcore/app/serializers/status.py 100% <100%> (ø) ⬆️
pulpcore/app/models/__init__.py 100% <100%> (ø) ⬆️
pulpcore/app/views/status.py 76.92% <60%> (-1.81%) ⬇️
pulpcore/app/models/status.py 81.81% <81.81%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae6be0d...9d6d2f2. Read the comment docs.

@bmbouter bmbouter force-pushed the add-content-app-to-status-api branch 4 times, most recently from 49cb4bd to 5bd6658 Compare June 24, 2019 20:42
CHANGES/4881.feature Outdated Show resolved Hide resolved
now = timezone.now()
age_threshold = now - timedelta(seconds=settings.CONTENT_APP_TTL)

return self.last_heartbeat < age_threshold
Copy link
Contributor

Choose a reason for hiding this comment

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

What about returning not online() to de-dupe logic?

@bmbouter bmbouter force-pushed the add-content-app-to-status-api branch from 5bd6658 to 96f6fec Compare June 24, 2019 21:15
A new model is introduced called `ContentAppStatus` is introduced which
will record status check-in records from the Content App.

The Content App will check in periodically checkin and write to the
`ContentAppStatus` object.

To tell the ContentAppStatus records apart for multiple Content Apps
each Content App now requires a name. The name is auto-selected as
'{pid}@{hostname}'.

The Status API viewset now shows a 'content_apps' section which lists
the ContentAppStatus records, showing their names and last heartbeat
time.

Adds a doc and feature changelog entries.

https://pulp.plan.io/issues/4881
closes pulp#4881
@bmbouter bmbouter force-pushed the add-content-app-to-status-api branch from 96f6fec to 9d6d2f2 Compare June 24, 2019 21:19
@bmbouter bmbouter merged commit 5d88dd4 into pulp:master Jun 24, 2019
@bmbouter bmbouter deleted the add-content-app-to-status-api branch June 24, 2019 22:13
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.

None yet

2 participants