Jump to: navigation, search

Difference between revisions of "Equinox p2 download stats"

(Enabling stats in your repository)
Line 27: Line 27:
 
want to gather stats for. You can pick one plugin in your feature for example:
 
want to gather stats for. You can pick one plugin in your feature for example:
  
    <artifact classifier='osgi.bundle' id='test.plugin1'
+
  <artifact classifier='osgi.bundle' id='test.plugin1' version='1.0.0.201003261255'>
version='1.0.0.201003261255'>
+
    <properties size='3'>
      <properties size='3'>
+
      <property name='artifact.size' value='0'/>
        <property name='artifact.size' value='0'/>
+
      <property name='download.size' value='1757'/>
        <property name='download.size' value='1757'/>
+
      '''<property name='download.stats' value='test.plugin1.bundle'/>'''
        '''<property name='download.stats' value='test.plugin1.bundle'/>'''
+
    </properties>
      </properties>
+
  </artifact>
    </artifact>
+
  
 
In this example, after a successful download a HEAD request will be issued to:
 
In this example, after a successful download a HEAD request will be issued to:

Revision as of 14:13, 28 April 2010

Overview

p2 includes a rudimentary mechanism for obtaining download statistics to track transfers from an artifact repository. This page describes how to enable statistics gathering for artifacts in your p2 repositories.

The p2 download statistics mechanism has the following characteristics:

  1. Statistics collection is "best effort": transfers do not fail if stats could not be collected
  2. Each artifact repository controls how and where statistics are collected for transfers from

that repository. If artifact repository A is gathering statistics, and an artifact is transferred from repository A to B, and then from repository B to C, repository A will only obtain statistics for the transfer from A to B.

  1. No personal information is collected. Essentially the statistics just summarize the transfers that have occurred from that repository.
  2. The repository maintainer can control the granularity of statistics gathered. For example they can record every single artifact transfer, or only transfers of particular artifacts. In general it is best to minimize the set of artifacts that are tracked, since each artifact transfer that is recorded incurs an extra round trip from the client to the repository.

Enabling stats in your repository

There are two steps to enable it:

1) In the artifact repository that you want to track downloads from, add a p2.statsURI property specifying the statistics URL (in artifacts.jar):

 <repository name='Update Site'

type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1'>

   <properties size='3'>
     <property name='p2.timestamp' value='1269575706171'/>
     <property name='p2.compressed' value='true'/>
     <property name='p2.statsURI' value='http://your.stats.server/stats'/>

2) In the same repository, add a download.stats property for each IU that you want to gather stats for. You can pick one plugin in your feature for example:

 <artifact classifier='osgi.bundle' id='test.plugin1' version='1.0.0.201003261255'>
   <properties size='3'>
     <property name='artifact.size' value='0'/>
     <property name='download.size' value='1757'/>
     <property name='download.stats' value='test.plugin1.bundle'/>
   </properties>
 </artifact>

In this example, after a successful download a HEAD request will be issued to:

 http://your.stats.server/stats/test.plugin.1.bundle

(value of the downloads.stats property appended to the value of the p2.statsURI).

References

bug 302160