Scheduled Learning for Continuous Modernization
Overview
vFunction can continuously monitor various metrics of an application and can alert following certain occurrences, such as crossing a Technical Debt threshold or changes to a common library.
vFunction can provide continuous assessments and continuous modernization. Continous assessments are based on static analysis using the Viper CLI. And, Continuous modernization is based on scheduled learning.
Scheduled Learning for Continuous Modernization
Continous Modernization enables automatic learning and analysis based on a schedule. Alerts via e-mail or Slack will be sent for various occurrences as shown in the figure above.
To setup the continuous modernization plan:
- Click Observation tab in the menu bar of vFunction Server’s UI
- Click the Pencil Icon next to Configuration on the left-hand sidebar
- A Dialog Box will launch with four sections on the left-hand sidebar
- In Configure Alerts, select the types of Alerts to be sent
- In Configure Plan, select the Baseline Measurement as a point of reference. New Learning Data and Notifications will be compared to this measurement (e.g., when a new service is added)
- In Configure Learning, select the frequency that Learning will occur and the Controllers on which Learning will occur
- In Configuring Schedule, define how frequently the Analysis will run to create a new Measurement based on the Learning that has occurred. For example, set Learning to occur daily and Analysis to occur weekly to create a new Measurement each week with all of the Learning data from that week.
- Click Confirm Changes to finish configuring Continuous Modernization
- After the Analysis Schedule has completed, a new timestamped Measurement will be created with the naming convention, Scheduled - DD-MMM-YYYY HH:MM (UTC+00:00)
Alerts from Scheduled Learning
The Configure Alerts tab is used to set up which architectural events detected during the auto analysis should trigger notifications (left column) and whether Slack and email notifications should be sent to the Users that are authorized to access the application in vFunction and the vFunction platform admins.
Plans from Scheduled Learning
The Configure Plan tab in the config dialog is used to setup the Baseline Measurement as well as enable CI/CD (or other automation) to trigger auto learning and analysis.
First, you have to select the Baseline Measurement (Select Base Measurement). A new measurement created by the automatic learning and analysis (called Latest measurement) will be compared to the Baseline Measurement. Based on this, the alerts and TODOs will be updated.
An External Trigger enables you to start and stop Learning by running a script, usually as part of the CI/CD pipeline. To set up an External Trigger, you should select the relevant Agent, download the Triggered Learning script and use the commands to Start and Stop Learning as part of your CI/CD pipeline.
Note that the Triggered Learning script is a Bash script that uses a Service Account. Follow these steps to generate a Service Account:
- Log into the vFunction Server UI
- Click on the person icon in the upper-right corner
- Select My Account in the dropdown menu
- Select Generate Service Account in the center pane
- Copy the Service Account ID and Password for use with the External Trigger script in your CI/CD pipeline
Schedules for Scheduled Learning
The Configure Schedule tab is used to set one or more Schedules to perform automatic Learning and Analysis by the vFunction server itself.
Scheduled Learning is especially useful when the Learning is done on a system that is continuously running, e.g., production.
- Set Learning Frequency: You can set the frequency of the data collection and it’s start / end time by setting the Repeat field. This can be for a specific set of hours that occurs on a specific day of each week or daily
- Set Agents: Select one or more Agents for the data collection, or use Tags to select all or one of the Agents that matches the Tag used during installation
- Set Analysis Frequency: Choose the analysis frequency, separately from the learning. This option is useful when multiple learning sessions are required in order to get a useful analysis. The Analysis Schedule frequency needs to be equal or lower than the Repeat Learning frequency. For example, you can schedule a daily data collection between 12:00 to 14:00 and weekly analysis
After confirming the changes, the configuration and schedules are listed on the left bottom of the Observation page. Once a Scheduled Learning starts, it is indicated on that list. The Measurement of the Scheduled Learning is not accessible until the corresponding analysis is completed. Only then, you can view the results and the updated notifications and TODOs.
Setting a Baseline
After obtaining an architectural design that represents the Domains for the Application, you should select the Measurement to be the Baseline Measurement of the Application:
Method 1: From the Analysis tab
- Log into the vFunction Server UI
- Select Analysis in the top, center menu bar
- Hover over the Measurement in the top of the left-hand sidebar
- Select Set as Baseline to set the current Measurement as the Baseline Measurement
Method 2: From the Observation Tab for future Scheduled Measurements
- Log into the vFunction Server UI
- Select Observation in the top, center menu bar
- Click the Pencil icon in the left-hand sidebar next to Configuration
- Select Configure Plan in the left-hand sidebar of the dialog box
- Click the text field below Select Baseline Measurement to select the appropriate Measurement as the baseline
Backlog TODOs from the Baseline
A key motivation for setting a Baseline Measurement is to start using Architectural Observability (AO) for monitoring and remediating architectural technical debt and creating TODO items reflecting the existing gaps in the architecture that need to be addressed by changing the application code.
Once the Baseline Measurement is selected, you will get some automatic Backlog TODOs, for example TODOs regarding high-debt classes (reduce their high debt score). Also, you will be able to create some manual TODOs, for example, you will be able to create TODO for non-exclusive resources and classes (make them exclusive) or for dead-code classes (remove references to them) as tasks that need to be done in the code itself.
Performing the tasks associated with these TODOs will cause an automatic change in the TODOs status following an automatic learning as we will see in the Continuous Modernization using AO section.