Quantcast

[sonar-dev] Increase project_measures.text_value column

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Increase project_measures.text_value column

Patroklos Papapetrou
Hi Sonar devs

Is there any chance to increase the size of text_value column in project_measures table?
Currently is 96 but I need 120 :(
Regards
Patroklos
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Increase project_measures.text_value column

Simon Brandhof
The limit is much more higher. Indeed string values are automatically stored in the MEASURE_DATA table if size is greater than 96.
Of course it requires to use the API and to not directly execute SQL :D

On 6 September 2012 10:41, Papapetrou P.Patroklos <[hidden email]> wrote:
Hi Sonar devs

Is there any chance to increase the size of text_value column in project_measures table?
Currently is 96 but I need 120 :(
Regards
Patroklos



--

Simon BRANDHOF | SonarSource
http://sonarsource.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Increase project_measures.text_value column

Patroklos Papapetrou
Hi again Simon 

is just calling context.saveMeasure (Measure myMeasure) is enough to store these data in MEASURE_DATA table?
The current behavior is that nothing is stored either in PROJECT_MEASURES and MEASURE_DATA :( where as if size < 96 data are stored in PROJECT_MEASURES 


2012/9/6 Simon Brandhof <[hidden email]>
The limit is much more higher. Indeed string values are automatically stored in the MEASURE_DATA table if size is greater than 96.
Of course it requires to use the API and to not directly execute SQL :D


On 6 September 2012 10:41, Papapetrou P.Patroklos <[hidden email]> wrote:
Hi Sonar devs

Is there any chance to increase the size of text_value column in project_measures table?
Currently is 96 but I need 120 :(
Regards
Patroklos



--

Simon BRANDHOF | SonarSource
http://sonarsource.com


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Increase project_measures.text_value column

Simon Brandhof

is just calling context.saveMeasure (Measure myMeasure) is enough to store these data in MEASURE_DATA table?

Yes
 
The current behavior is that nothing is stored either in PROJECT_MEASURES and MEASURE_DATA :( where as if size < 96 data are stored in PROJECT_MEASURES

It seems that the problem does not relate to the text size. Can you confirm by using a short value ? In this case the pb can relate to the definition of the metric or to the PersistenceMode. Feel free to send some code, it will be easier to help you.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Increase project_measures.text_value column

Patroklos Papapetrou
When setting a short value it's successfully stored in DB.
Here is my Metric Definition
  public static final Metric SCM_COMMITS_PER_CLOCKTIME = 
          new Metric.Builder("scm-commits-per-clockhour", "Commits per clock hour", 
          Metric.ValueType.DISTRIB)
      .setDescription("Commits per clock hour")
      .setQualitative(false)
      .setDomain(CoreMetrics.DOMAIN_SCM)
      .create();

and here is the code that saves it
  private final Map<String, Integer> commitsPerClockHour = new HashMap<String, Integer>();
    
    final PropertiesBuilder<String, Integer> commitsPerClockHourMeasure =
            propertiesBuilder(ScmStatsMetrics.SCM_COMMITS_PER_CLOCKTIME);
    commitsPerClockHourMeasure.addAll(commitsPerClockHour);
    context.saveMeasure(commitsPerClockHourMeasure.build());

  private static PropertiesBuilder<String, Integer> propertiesBuilder(Metric metric) {
    return new PropertiesBuilder<String, Integer>(metric);
  }

2012/9/6 Simon Brandhof <[hidden email]>

is just calling context.saveMeasure (Measure myMeasure) is enough to store these data in MEASURE_DATA table?

Yes
 
The current behavior is that nothing is stored either in PROJECT_MEASURES and MEASURE_DATA :( where as if size < 96 data are stored in PROJECT_MEASURES

It seems that the problem does not relate to the text size. Can you confirm by using a short value ? In this case the pb can relate to the definition of the metric or to the PersistenceMode. Feel free to send some code, it will be easier to help you.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Increase project_measures.text_value column

David François

Try to change the ValueType of your metric to Metric.ValueType.DATA

 

De : Papapetrou P.Patroklos [mailto:[hidden email]]
Envoyé : jeudi 6 septembre 2012 11:08
À : [hidden email]
Objet : Re: [sonar-dev] Increase project_measures.text_value column

 

When setting a short value it's successfully stored in DB.

Here is my Metric Definition

  public static final Metric SCM_COMMITS_PER_CLOCKTIME = 

          new Metric.Builder("scm-commits-per-clockhour", "Commits per clock hour", 

          Metric.ValueType.DISTRIB)

      .setDescription("Commits per clock hour")

      .setQualitative(false)

      .setDomain(CoreMetrics.DOMAIN_SCM)

      .create();

 

and here is the code that saves it

  private final Map<String, Integer> commitsPerClockHour = new HashMap<String, Integer>();

    

    final PropertiesBuilder<String, Integer> commitsPerClockHourMeasure =

            propertiesBuilder(ScmStatsMetrics.SCM_COMMITS_PER_CLOCKTIME);

    commitsPerClockHourMeasure.addAll(commitsPerClockHour);

    context.saveMeasure(commitsPerClockHourMeasure.build());

 

  private static PropertiesBuilder<String, Integer> propertiesBuilder(Metric metric) {

    return new PropertiesBuilder<String, Integer>(metric);

  }

 

2012/9/6 Simon Brandhof <[hidden email]>

 

is just calling context.saveMeasure (Measure myMeasure) is enough to store these data in MEASURE_DATA table?


Yes
 

The current behavior is that nothing is stored either in PROJECT_MEASURES and MEASURE_DATA :( where as if size < 96 data are stored in PROJECT_MEASURES


It seems that the problem does not relate to the text size. Can you confirm by using a short value ? In this case the pb can relate to the definition of the metric or to the PersistenceMode. Feel free to send some code, it will be easier to help you.

 

 


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Increase project_measures.text_value column

Patroklos Papapetrou
Hi David 
Indeed it's working. I can see the values in MEASURE_DATA table, but how can I get this metric in my widget?
Using measure("scm-commits-per-clockhour") doesn't seem to retrieve any data... :(

Regards
Patroklos

2012/9/6 Francois, David <[hidden email]>

Try to change the ValueType of your metric to Metric.ValueType.DATA

 

De : Papapetrou P.Patroklos [mailto:[hidden email]]
Envoyé : jeudi 6 septembre 2012 11:08
À : [hidden email]
Objet : Re: [sonar-dev] Increase project_measures.text_value column

 

When setting a short value it's successfully stored in DB.

Here is my Metric Definition

  public static final Metric SCM_COMMITS_PER_CLOCKTIME = 

          new Metric.Builder("scm-commits-per-clockhour", "Commits per clock hour", 

          Metric.ValueType.DISTRIB)

      .setDescription("Commits per clock hour")

      .setQualitative(false)

      .setDomain(CoreMetrics.DOMAIN_SCM)

      .create();

 

and here is the code that saves it

  private final Map<String, Integer> commitsPerClockHour = new HashMap<String, Integer>();

    

    final PropertiesBuilder<String, Integer> commitsPerClockHourMeasure =

            propertiesBuilder(ScmStatsMetrics.SCM_COMMITS_PER_CLOCKTIME);

    commitsPerClockHourMeasure.addAll(commitsPerClockHour);

    context.saveMeasure(commitsPerClockHourMeasure.build());

 

  private static PropertiesBuilder<String, Integer> propertiesBuilder(Metric metric) {

    return new PropertiesBuilder<String, Integer>(metric);

  }

 

2012/9/6 Simon Brandhof <[hidden email]>

 

is just calling context.saveMeasure (Measure myMeasure) is enough to store these data in MEASURE_DATA table?


Yes
 

The current behavior is that nothing is stored either in PROJECT_MEASURES and MEASURE_DATA :( where as if size < 96 data are stored in PROJECT_MEASURES


It seems that the problem does not relate to the text size. Can you confirm by using a short value ? In this case the pb can relate to the definition of the metric or to the PersistenceMode. Feel free to send some code, it will be easier to help you.

 

 


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Increase project_measures.text_value column

David François

If measure("scm-commits-per-clockhour") is not nil, you can use measure("scm-commits-per-clockhour").data

 

Regards,

David FRANCOIS

 

De : Papapetrou P.Patroklos [mailto:[hidden email]]
Envoyé : jeudi 6 septembre 2012 12:14
À : [hidden email]
Objet : Re: [sonar-dev] Increase project_measures.text_value column

 

Hi David 

Indeed it's working. I can see the values in MEASURE_DATA table, but how can I get this metric in my widget?

Using measure("scm-commits-per-clockhour") doesn't seem to retrieve any data... :(

 

Regards

Patroklos

 

2012/9/6 Francois, David <[hidden email]>

Try to change the ValueType of your metric to Metric.ValueType.DATA

 

De : Papapetrou P.Patroklos [mailto:[hidden email]]
Envoyé : jeudi 6 septembre 2012 11:08
À : [hidden email]
Objet : Re: [sonar-dev] Increase project_measures.text_value column

 

When setting a short value it's successfully stored in DB.

Here is my Metric Definition

  public static final Metric SCM_COMMITS_PER_CLOCKTIME = 

          new Metric.Builder("scm-commits-per-clockhour", "Commits per clock hour", 

          Metric.ValueType.DISTRIB)

      .setDescription("Commits per clock hour")

      .setQualitative(false)

      .setDomain(CoreMetrics.DOMAIN_SCM)

      .create();

 

and here is the code that saves it

  private final Map<String, Integer> commitsPerClockHour = new HashMap<String, Integer>();

    

    final PropertiesBuilder<String, Integer> commitsPerClockHourMeasure =

            propertiesBuilder(ScmStatsMetrics.SCM_COMMITS_PER_CLOCKTIME);

    commitsPerClockHourMeasure.addAll(commitsPerClockHour);

    context.saveMeasure(commitsPerClockHourMeasure.build());

 

  private static PropertiesBuilder<String, Integer> propertiesBuilder(Metric metric) {

    return new PropertiesBuilder<String, Integer>(metric);

  }

 

2012/9/6 Simon Brandhof <[hidden email]>

 

is just calling context.saveMeasure (Measure myMeasure) is enough to store these data in MEASURE_DATA table?


Yes
 

The current behavior is that nothing is stored either in PROJECT_MEASURES and MEASURE_DATA :( where as if size < 96 data are stored in PROJECT_MEASURES


It seems that the problem does not relate to the text size. Can you confirm by using a short value ? In this case the pb can relate to the definition of the metric or to the PersistenceMode. Feel free to send some code, it will be easier to help you.

 

 


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

 


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Increase project_measures.text_value column

Patroklos Papapetrou
Thanks a lot David!!
Problem solved!!! :)
Regards
Patroklos

2012/9/6 Francois, David <[hidden email]>

If measure("scm-commits-per-clockhour") is not nil, you can use measure("scm-commits-per-clockhour").data

 

Regards,

David FRANCOIS

 

De : Papapetrou P.Patroklos [mailto:[hidden email]]
Envoyé : jeudi 6 septembre 2012 12:14


À : [hidden email]
Objet : Re: [sonar-dev] Increase project_measures.text_value column

 

Hi David 

Indeed it's working. I can see the values in MEASURE_DATA table, but how can I get this metric in my widget?

Using measure("scm-commits-per-clockhour") doesn't seem to retrieve any data... :(

 

Regards

Patroklos

 

2012/9/6 Francois, David <[hidden email]>

Try to change the ValueType of your metric to Metric.ValueType.DATA

 

De : Papapetrou P.Patroklos [mailto:[hidden email]]
Envoyé : jeudi 6 septembre 2012 11:08
À : [hidden email]
Objet : Re: [sonar-dev] Increase project_measures.text_value column

 

When setting a short value it's successfully stored in DB.

Here is my Metric Definition

  public static final Metric SCM_COMMITS_PER_CLOCKTIME = 

          new Metric.Builder("scm-commits-per-clockhour", "Commits per clock hour", 

          Metric.ValueType.DISTRIB)

      .setDescription("Commits per clock hour")

      .setQualitative(false)

      .setDomain(CoreMetrics.DOMAIN_SCM)

      .create();

 

and here is the code that saves it

  private final Map<String, Integer> commitsPerClockHour = new HashMap<String, Integer>();

    

    final PropertiesBuilder<String, Integer> commitsPerClockHourMeasure =

            propertiesBuilder(ScmStatsMetrics.SCM_COMMITS_PER_CLOCKTIME);

    commitsPerClockHourMeasure.addAll(commitsPerClockHour);

    context.saveMeasure(commitsPerClockHourMeasure.build());

 

  private static PropertiesBuilder<String, Integer> propertiesBuilder(Metric metric) {

    return new PropertiesBuilder<String, Integer>(metric);

  }

 

2012/9/6 Simon Brandhof <[hidden email]>

 

is just calling context.saveMeasure (Measure myMeasure) is enough to store these data in MEASURE_DATA table?


Yes
 

The current behavior is that nothing is stored either in PROJECT_MEASURES and MEASURE_DATA :( where as if size < 96 data are stored in PROJECT_MEASURES


It seems that the problem does not relate to the text size. Can you confirm by using a short value ? In this case the pb can relate to the definition of the metric or to the PersistenceMode. Feel free to send some code, it will be easier to help you.

 

 


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

 


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

Loading...