24 Commits

Author SHA1 Message Date
Cliff Hill
4429e48221 More changes are done.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:56:32 -05:00
Cliff Hill
3982f061b6 Made enums.py for all the enums to avoid cyclic imports.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:31 -05:00
Cliff Hill
ac9591ec7c More tweaks, trying to get tests to be clean.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:31 -05:00
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Kenneth Kehl
08c1ad75c8 notify-260 remove server-side timezone handling 2023-05-10 08:39:50 -07:00
Steven Reilly
ff4190a8eb Remove letters-related code (#175)
This deletes a big ol' chunk of code related to letters. It's not everything—there are still a few things that might be tied to sms/email—but it's the the heart of letters function. SMS and email function should be untouched by this.

Areas affected:

- Things obviously about letters
- PDF tasks, used for precompiling letters
- Virus scanning, used for those PDFs
- FTP, used to send letters to the printer
- Postage stuff
2023-03-02 20:20:31 -05:00
stvnrlly
9e7ee1c0f8 migrate bst_date to local_date 2022-11-21 11:49:59 -05:00
stvnrlly
b50cb4712f tz utility swap and many test updates 2022-11-10 12:33:25 -05:00
David McDonald
41d95378ea Remove everything for the performance platform
We no longer will send them any stats so therefore don't need the code
- the code to work out the nightly stats
- the performance platform client
- any configuration for the client
- any nightly tasks that kick off the sending off the stats

We will require a change in cronitor as we no longer will have this task
run meaning we need to delete the cronitor check.
2021-03-15 12:04:53 +00:00
David McDonald
8325431462 Move saving of processing time into separate task
We current do this as part of send-daily-performance-platform-stats but
now this moves it into its own separate task. This is for two reasons
- we will shortly get rid of the send-daily-performance-platform-stats
  task as we no longer will need to send anything to performance
  platform
- even if we did decide to keep the task
  send-daily-performance-platform-stats and remove the specific bits
  that relate to the performance platform, it's probably nicer to
  rewrite the new task from scratch to make sure it's all clear and easy
  to understand
2021-03-15 11:44:01 +00:00
Ben Thorner
a91fde2fda Run auto-correct on app/ and tests/ 2021-03-12 11:45:45 +00:00
Rebecca Law
21edf7bfdd Persist the processing time statistics to the database.
The performance platform is going away soon. The only stat that we do not have in our database is the processing time. Let me clarify the only statistic we don't have in our database that we can query efficiently is the processing time. Any queries on notification_history are too inefficient to use on a web page.
Processing time = the total number of normal/team emails and text messages plus the number of messages that have gone from created to sending within 10 seconds per whole day. We can then easily calculate the percentage of messages that were marked as sending under 10 seconds.
2021-02-26 07:49:49 +00:00
Leo Hemsted
5045590d75 allow you to pass in date to send perf stats
make it easier to replay sending data for a day if it failed the first
time round
2019-06-11 13:57:17 +01:00
Leo Hemsted
3739d9055d clean up usage of dates/datetimes in performance platform tasks
* call variables unambiguous things like `start_time` or `bst_date` to
  reduce risk of passing in the wrong thing
* simplify the count_dict object - remove nested dict and start_date
  fields as superfluous
* use static datetime objects in tests rather than calculating them
  each time
2019-04-02 11:49:20 +01:00
Toby Lorne
4abbb7137a Fix sending of performance platform
The pp client converts to UTC using the convert_utc_to_bst notify util.

This requires a datatime not a date, pass it a datetime, and add an
assertion in an existing test.

I didn't want to use the midnight conversion util in the test.

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
2019-04-02 09:06:39 +01:00
Rebecca Law
1806f092f3 Update the nightly task that send performance platform statistics to use ft_notification_status rather than notification_history.
The previous query was including all notifications regardless of notification_status. I don't think that's right, it shouldn't include things like technical-failure or validation-failed. Thoughts?

I also need to remove the query that's no longer being used.
2019-03-29 14:21:05 +00:00
Chris Hill-Scott
ca167206d5 Add command to backfill Performance Platform totals
We don’t have any way of playing back the totals we send to performance
platform.

This commit copies the command used to backfill the processing time and
adapts it to backfill the totals instead. Under the hood it uses the
same code that we use in the scheduled tasks to update performance
platform on a daily basis. I had to modify this code to take a `day`
argument because it was hardcoded to only work for ‘yesterday’.
2018-03-05 17:02:33 +00:00
Chris Hill-Scott
7e1aa03371 Send count of sent letters to performance platform
Now we’ve been sending real letters for quite a while it would be nice
to show how many.
2018-03-02 16:54:48 +00:00
Leo Hemsted
378b131c59 add batch task to backfill processing time data
give it a start date and an end date, and it'll send data to the
performance platform for all dates in that (inclusive)
2017-08-31 14:41:05 +01:00
Imdad Ahad
ea2f838510 Fix typo 2017-08-31 11:10:54 +01:00
Katie Smith
a1a5fdedb1 Send results of processing-time query to performance platform 2017-08-30 14:40:10 +01:00
Leo Hemsted
e85b621cbc make perf platform client handle more stuff sensibly
specifically, all of the performance platform specific data layout now
happens in performance_platform_client.py - stuff like setting the
_timestamp, period etc, and the perf platform-specific nomenclature is
all handled there.
2017-08-24 17:10:42 +01:00
Leo Hemsted
412c87cfc8 pycodestyle 2017-08-24 10:52:47 +01:00
Leo Hemsted
89f4f5173e refactor performance platform code
so that it doesn't appear generic when it's actually specific to
sending the daily notification totals. To do this, split it out into a
separate performance_platform directory, containing the business logic,
and make the performance_platform_client incredibly thin - all it
handles is adding ids to payloads, and sending stats.

Also, some changes to the config (not all done yet) since there is one
token per endpoint, not one for the whole platform as we'd previously
coded
2017-08-23 17:37:29 +01:00