' Diagram showing sequence of tasks to set up PMM Client for MySQL
' Syntax: https://plantuml.com/activity-diagram-beta
' Icons: https://plantuml.com/openiconic
' Colour: https://plantuml.com/color
' Text: https://plantuml.com/creole
@startuml "setting-up_client_mysql"
!include _resources/diagrams/plantuml_styles.puml
'title "Setting up PMM Client to monitor a MySQL host\nOverview\n"
legend bottom left
Legend
<#ffb366>| Required |
<#lightgrey>| Optional |
endlegend

#lightgrey:Create a database account for PMM;
partition "Choose and configure\na source" {
	split
		:Configure //slow query log//;
		:Configure //slow query log (extended)//;
		#lightgrey:Configure //slow query log rotation//;
	split again
		:Configure //Performance Schema//;
	end split
}
	#lightgrey:Configure //query response time//;
	#lightgrey:Configure //tablestats//;
	#lightgrey:Configure //user statistics//;
partition "Add a service " {
	split
	-> With user interface;
		:PMM <&arrow-thick-right>\nPMM Add Instance <&arrow-thick-right>\nMySQL -\nAdd a remote instance;
	split again
	-> On command line;
		split
			-> Slow query log;
			:<code>
			pmm-admin add mysql
			--query-source=slowlog
			--size-slow-logs=N
			...
			</code>;
		split again
			-> Performance Schema;
			:<code>
			pmm-admin add mysql
			--query-source=perfschema
			...
			</code>;
		end split
	end split
}
#lightgrey:Check the service;
@enduml
